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
SAS Super FREQ
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

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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