BookmarkSubscribeRSS Feed
master_jiang
Calcite | Level 5

Hi All,

    I met a problem which confused me a lot. I'm using ods option and PROC REPORT to output a dataset in excel format. However, in my dataset, I assign a variable with period "." as missing value. The variable is character and it contains two values such as "1500" and ".". When proc report process done, in SAS EG output window, the result display as . and 1500 while in excel file, it display as 0 and 1500. Attachment are the snaps.

 

Snap1.png is the screenshot of result window in SAS EG ,variable cc is displayed as period and 1500

Snap2.png is the screenshot of reporint dataset, variable dose_act(which is cc) is shown as . and 1500 for charater variable

Snap3.png is the screenshot of output excel file, variable dose_act is shown as 0 and 1500.

By the way, in snap3.png there are two more variables LIMIT and CENS, these two variables also contains period as charater variable but in excel file can display as . alsosnap1.PNGsnap2.PNGsnap3.PNG

 

1 REPLY 1
master_jiang
Calcite | Level 5
ods listing close;
ods excel file = "&path..xlsx"
options(sheet_name="1-PK"
frozen_headers="on"
frozen_rowheaders="1"
autofilter="ALL"
embedded_titles="ON"
EMBEDDED_FOOTNOTES="ON");
title;
footnote;


proc report data=pk1 nowd missing headline split="~" style(header)=[bordertopwidth=0pt borderbottomwidth=0pt] style(column)=[just=c];
column obs id time nominal_tafd dose_act limit cens;
define obs / style(column)=[just=L] style(header)=[borderbottomwidth=0.1pt just=L] "Obs";
define id / style(column)=[just=L] style(header)=[borderbottomwidth=0.1pt just=L] "ID";
define time / style(column)=[just=L] style(header)=[borderbottomwidth=0.1pt just=L] "aa";
define nominal_tafd / style(column)=[just=L] style(header)=[borderbottomwidth=0.1pt just=L] "bb";
define dose_act/ style(column)=[just=L] style(header)=[borderbottomwidth=0.1pt just=L] "cc";
define limit / style(column)=[just=L] style(header)=[borderbottomwidth=0.1pt just=L] "LIMIT";
define cens / style(column)=[just=L] style(header)=[borderbottomwidth=0.1pt just=L] "CENS";
run;

ods excel close;

Above is my code, cheers

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 339 views
  • 0 likes
  • 1 in conversation