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

Hi

When I make crosstabs by using Proc Freq, I get the following output:

Unavngivet.png

How can I left-align the row values? (ie. Z038/39 and Z048)

I'm using SAS EG 5.1 32 bit.

Hope someone can help.

Thank you.

1 ACCEPTED SOLUTION

Accepted Solutions
Ksharp
Super User

How about this one :

data class;
 set sashelp.class;
 length _sex $ 40;
 _sex=catx(' ','~S={just=l}',sex);
run;



ods listing close;
ods pdf file='c:\temp\x.pdf';
ods escapechar='~';
proc freq data=class ;
table _sex*age/norow nocol nopercent nocum ;
run;
ods pdf close;
ods listing;

x.png

Xia Keshan

View solution in original post

3 REPLIES 3
Ksharp
Super User

How about this one :

data class;
 set sashelp.class;
 length _sex $ 40;
 _sex=catx(' ','~S={just=l}',sex);
run;



ods listing close;
ods pdf file='c:\temp\x.pdf';
ods escapechar='~';
proc freq data=class ;
table _sex*age/norow nocol nopercent nocum ;
run;
ods pdf close;
ods listing;

x.png

Xia Keshan

Boka98
Calcite | Level 5

Thank you for your answer.

It Works perfectly.

Great way to use the ODS Escape Char Smiley Happy

ballardw
Super User

Or slight modification:

proc format library=work;
value $sextemp
'F' = '~S={just=L}F'
'M' = '~S={just=L}M'
;
run;
quit;

ods escapechar='~';
proc freq data=class ;
table sex*age/norow nocol nopercent nocum ;
format sex $sextemp.;
run;

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!
SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 2048 views
  • 3 likes
  • 3 in conversation