BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ncsthbell
Quartz | Level 8

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:@'}

 

1 ACCEPTED SOLUTION

Accepted Solutions
ncsthbell
Quartz | Level 8

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!

View solution in original post

3 REPLIES 3
ncsthbell
Quartz | Level 8

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:@'}

Ksharp
Super User

Maybe you could try 

 

style={tagattr='Format:000,000'}

 

ncsthbell
Quartz | Level 8

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!

sas-innovate-2024.png

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.

 

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
  • 3 replies
  • 1498 views
  • 2 likes
  • 2 in conversation