I am using SAS 9.2, and Excel 2003 for this task. I have 400 observations that my boss wants in excel worksheet with a blank line after every 5th observation. This was a simple task, so we used ODS with a print statement. Below is the code:
ods html file = "C:\testing files\laboutput %sysfunc(today(),date9.).xls"
Headtext=" .Zero {mso-number-format:\@} ";
ods noptitle;
options pageno=1 orientation=landscape;
PROC PRINT data= foura NOOBS BLANKLINE=5 LABEL SPLIT='*';
VAR NEWID /style={HTMLCLASS = 'Zero'};
VAR VISITDATE ASSESSVISITDATE;
LABEL VISITDATE='Weekly*VisitDate'
ASSESSVISITDATE='*Med*AssessDate';
FORMAT NEWID $13. ;
RUN;
ODS HTML CLOSE;
RUN;
When looking at the dataset, NEWID is a character variable that is a mix of numeric and character strings. Below are my actual NEWID values along with the way it looks in my excel output:
NEWID in data~~~~~~NEWID in excel
111142900202~~~~~~1.11143E+11
1111214A0203~~~~~~1111214A0203
1111216D0103~~~~~~1111216D0103
111121400202~~~~~~1.11121E+11
1111715E0106~~~~~~1.11E+112
The string that have both letters and numbers are being displayed correctly, but the strings that have only numbers OR include an E are being displayed in Scientific Notation format.
I’m at a loss, and need some experienced SAS help here!! I want NEWID to show as text, and hopefully I’ve done something wrong in my code. When I click in the excel cells, the correct values are being shown in the formula bar. I’ve tried different formats in excel, and nothing is working completely. The values that already include an E are looking really messy!!
I’m open to any direction.
LisaB
... View more