The SAS Output Delivery System and reporting techniques

xls file from ODS

Reply
N/A
Posts: 0

xls file from ODS

Hi SAS users,

I'm trying to export xls file using ODS. Unfortunately one from variables (account number) looking like this, for example:
19113011502011000006800006

When I use code:

Ods msoffice2k file="C:\temp\File_XLS..xls" style=statdoc newfile=bygroup;

Data _null_;
Title "MY raport";
Set File_to_export;
File print Ods;
Put _ods_;
Run;

Ods _all_ close;


…my variable account number looking like this:
8,9113011502009E+25

What I have to do to repair this ?

Sorry for my English Smiley Happy
Regards, Kosa
N/A
Posts: 0

Re: xls file from ODS

Posted in reply to deleted_user
not sure how within a data step, but within a proc print, I need to do the same. This code works [pre] id claimno ppsnum / style={tagattr="format:@"} ; [/pre] then the variables claimno and ppsnum appear in excel in full, with the flag "number stored as text".

In proc print, the "/ style= " statement option works on both ID and VAR statements but for some reason, not on a BY statement. Does anyone know why it is not logical to apply that option also there ?

PeterC
SAS Super FREQ
Posts: 8,866

Re: xls file from ODS

Posted in reply to deleted_user
Hi:
You can use similar syntax with a DATA step program, but it must be specified in a custom table template. It would be far easier in this situation to swap out the DATA step for a PROC PRINT or PROC REPORT step that used the style= override that sends the Microsoft format from SAS to Excel.

cynthia
Ask a Question
Discussion stats
  • 2 replies
  • 124 views
  • 0 likes
  • 2 in conversation