Hi all,
I have some '0' values in my table. When I put it in character format :
put (x,best.)
and then list in the table using Proc Report:
define var2 / " Column_name " style(header)=[cellwidth=10.5%] style(column)=[just=d posttext=' '] ;
I receive the following issue:
The column where I have just zero values and values without decimal are shifted right ( I marked green the line that should be shifted left ). I think that put '0' in the view' '0.000' will be enough to align the figures to the center. Have you ever faced the issue and what could be a solution for the case?
Thank you!
The solution was offered by one kind colleague:
define var2 / "Cohort XXXX" style(header)=[cellwidth=11.5%] style(column)=[just=c protectspecialchars=off pretext="\qj\tqdec\tx800 "] ;
Thus special 'report' code was used:
[just=c protectspecialchars=off pretext="\qj\tqdec\tx800 "]
where 800 can vary to shift the text. It is important to keep space after 800.
Are you attempting to align decimal points in character values? I don't think that is what the decimal align expects.
Also creating a character value with Put can create leading spaces which are significant when it comes to attempting to align anything.
Please look at this code:
data junk; x=0; y1= quote( put(x,best.) ); y2= quote( put(x,best3.) ); y3= quote( put(x,best5.) ); y4= quote( put(x,best. -L) ); run;
The quotes in the various Y values are to outline the resulting blanks in the created variable. Any format length longer than the value needs, except the Z format for leading 0's, will create leading blanks unless the -L option (to left justify the result) on the Put function is used.
The solution was offered by one kind colleague:
define var2 / "Cohort XXXX" style(header)=[cellwidth=11.5%] style(column)=[just=c protectspecialchars=off pretext="\qj\tqdec\tx800 "] ;
Thus special 'report' code was used:
[just=c protectspecialchars=off pretext="\qj\tqdec\tx800 "]
where 800 can vary to shift the text. It is important to keep space after 800.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
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.
Select SAS Training centers are offering in-person courses. View upcoming courses for: