I have researched the communities board on this and found learned that character data is changed to numeric data when it is output to excel via ODS. I have an 'ID' column which is a character format and can contain leading zeros. I am using PROC REPORT. I can't find any examples when using this. I have tried the following but it does not work. Maybe I am placing the tagattr in the wrong place? Any help would be appreciated!!
ORIGINAL proc report data=work.EOM_ACCCOUNTS; columns ID; Define ID / display 'Entity ID' LEFT style(column)=[font_size=8pt width=.5in] style(header)=[font_size=8pt font_face='Times' font_weight=bold just=LEFT]; CHANGED: proc report data=work.EOM_ACCCOUNTS; columns ID; Define ID / display 'Entity ID' LEFT style={tagattr='Format:@'}
Thanks Ksharp! I got it to work after trying many different ways. This is how I wound up getting the leading zeros:
Define ID / display 'Entity ID' style(column)=[font_size=8pt width=.7in tagattr='Format:@'] style(header)=[font_size=8pt font_face='Times' font_weight=bold just=LEFT];
I think my problem was I was trying to keep the '{' character inside the [font....]. When I removed the '{', it worked!
My copy/paste did not get all of the lines intended for under the 'CHANGED' for the code. Here are all the lines:
Define ID / display 'Entity ID' LEFT style={tagattr='Format:@'}
Maybe you could try
style={tagattr='Format:000,000'}
Thanks Ksharp! I got it to work after trying many different ways. This is how I wound up getting the leading zeros:
Define ID / display 'Entity ID' style(column)=[font_size=8pt width=.7in tagattr='Format:@'] style(header)=[font_size=8pt font_face='Times' font_weight=bold just=LEFT];
I think my problem was I was trying to keep the '{' character inside the [font....]. When I removed the '{', it worked!
Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.
Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.
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.