PROC DBLOADの問題点

Problem Note 13954: PROC DBLOAD to create an Excel 5.0 file does not apply numeric formatting correctlyより
SAS9.1.3でPROC DBLOADでExcel5.0を作成する際、Formatステートメントが正しく動作しないそうです。

data mydata;
input id $ Val1 9.3;
cards;
A001 12345.789
A002 221.133
A003 2910.915
;

* creates excel worksheet with '0000000000' custom format;
proc dbload dbms=excel
data=work.mydata;
path='c:\mydata1.xls';
format Val1 10.;
load;
run;

* creates excel worksheet with '00000000.0' custom format;
proc dbload dbms=excel
data=work.mydata;
path='c:\mydata2.xls';
format Val1 10.1;
load;
run;


* creates excel worksheet with correct numeric '0.00' format;
proc dbload dbms=excel
data=work.mydata;
path='c:\mydata3.xls';
format Val1 10.2;
load;
run;

After running the sample program, simply open mydate1.xls into Excel and
right-click on any data in the "B" column to select Properties and
select "Format Cells". This will show as a Custom format of type
"0000000000" which is incorrect.

解消する適応プログラムも上がっているようです。
http://www.sas.com/techsup/download/hotfix/e9_sbcs_prod_list.html

SAS 9.2では解消済のようです。

Debugオプションを試してみた

SAS Data Step Debuggerを試してみました。

ATA TEMP/DEBUG;
DO I=1 TO 10;
X=I*2;
OUTPUT;
END;
RUN;

実行すると、ログウィンドウの前に今まで見たことのない画面が。
よく見ると一番下の">"にコマンドを入力するようになっています。

ここで入力するコマンドは、SASのヘルプに掲載されていました。
こちらにも載っています。
List of Debugger Commands
本番の時に、DEBUGオプションを取り忘れそうですが、それでもうまく動かない時などには有意な方法だと思います。

SAS Data Step Debugger

SAS at MITより
DATAステートメントでdebugオプションなんてあったんですね。
後で試してみます。

To invoke the data step debugger, add the DEBUG option in the DATA statement. For example:

data temp/debug;
do i=1 to 10;
x=i*2;
output;
end;
run;