DATA Step, Macro, Functions and more

PROC PRINT - width of variable

Reply
Occasional Contributor
Posts: 6

PROC PRINT - width of variable

Hi,

 

I am trying to see how changing the width of a column in PROC print reflects in the output(window, HTML and PDF). I am using the SAS University Edition.

 

Should not specifying width=2 should limit the column width as 2 ? Against the column width specified as 2 , the column name is written as "customer region" which is greater than column width specified as 2.

 

Below is the code:

sas7.PNG

 

Output in Results window:

sas8.PNG

HTML output downloded:

sas9.PNG

PDF output downloaded:

sas10.PNG

 

Super User
Posts: 10,028

Re: PROC PRINT - width of variable

Posted in reply to mafiapainter
No. width=2 is only for LISTING ,not HTML destination.

...............
define region/group style={cellwidth=1 cm};


Occasional Contributor
Posts: 6

Re: PROC PRINT - width of variable

Appreciate your response and help on this. But I am getting the same result:

sas11.PNG

updated code:

sas12.PNG

SAS Super FREQ
Posts: 8,866

Re: PROC PRINT - width of variable

Posted in reply to mafiapainter
HI, 1 CM is rather small. If you want to guarantee that 'customer' is on one line and 'region' is on the next line, then use the split character to control the column label:
define region / group 'Customer*Region'
style(column)={cellwidth=2in};

cynthia
Trusted Advisor
Posts: 1,566

Re: PROC PRINT - width of variable

Posted in reply to Cynthia_sas

Pay attention, in all your outputs the customer region is leading zeros suppressed, there fore you got the region as one digit.

If you meant by width=2 to get the region as two digits, you should define its format as z2.

Ask a Question
Discussion stats
  • 4 replies
  • 437 views
  • 0 likes
  • 4 in conversation