BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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 🙂
Regards, Kosa
2 REPLIES 2
deleted_user
Not applicable
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
Cynthia_sas
Diamond | Level 26
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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 940 views
  • 0 likes
  • 2 in conversation