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!
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.
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.