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

Hi,

 

I have a variable param2 that have values of:

data:

HitmonTran_0-1645031891480.png

As you can see there are indentations but when I output it in my pdf,   the indentation of "N, Median, Min-Max, etc." is lost.  Any idea on how to preserve the indenation?

 

output:

HitmonTran_1-1645032048216.png

 

code:

  ods results off;
ods listing close;
;

options formchar="|----|+|---+=|-/\<>*" ls=70 ps=70 missing = " " nodate nonumber center;

  options orientation=landscape;
   
  ods rtf file = "&analpath\Output\&pgmout._&outp._Blind.rtf" style= TLF_CN_9;
    ods pdf file = "&analpath\Output\&pgmout._&outp._Blind.pdf" style= TLF_CN_9;
  
 
  proc report data=final nowindows center headline headskip missing split='|' spanrows;
	column  avisitn  order2 param2 trtg1 trtg2 trtg3 trtg4;
	    define avisitn   / order noprint;
	    define order2    / order noprint;
	    define param2 	 / order "Interferon-~{unicode gamma} ELISpot Spot-Forming Units (SFUs)" style(column)={just=left cellwidth=5.6in} flow style(header)={just=left font_size=9pt};
	    define trtg1     / display "1.0 " style(column)={asis=on just=center cellwidth=1.2 in} flow style(header)={just=center font_size=9pt};
	    define trtg2     / display "1" style(column)={asis=on just=center cellwidth=1.2 in} flow style(header)={just=center font_size=9pt};
	    define trtg3     / display "2.0" style(column)={asis=on just=center cellwidth=1.2 in} flow style(header)={just=center font_size=9pt};
	    define trtg4     / display "2" style(column)={asis=on just=center cellwidth=1.2in} flow style(header)={just=center font_size=9pt};


    break after param2/ skip;
	
    compute after param2 / style(lines)={font_size = 3pt};
/*      line " "; */
    endcomp;

  run;
ods _all_ close;
ods listing;
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

If you are displaying text with leading spaces, not at all clear as NO DATA provided (pictures really don't count as can't program with pictures), try adding the style override of ASIS=on. You already have that for other variables, so I'm not sure why you don't for Param2. The ASIS=on maintains things like leading spaces in the output.

 


@HitmonTran wrote:

Hi,

 

I have a variable param2 that have values of:

data:

HitmonTran_0-1645031891480.png

As you can see there are indentations but when I output it in my pdf,   the indentation of "N, Median, Min-Max, etc." is lost.  Any idea on how to preserve the indenation?

 

output:

HitmonTran_1-1645032048216.png

 

code:

  ods results off;
ods listing close;
;

options formchar="|----|+|---+=|-/\<>*" ls=70 ps=70 missing = " " nodate nonumber center;

  options orientation=landscape;
   
  ods rtf file = "&analpath\Output\&pgmout._&outp._Blind.rtf" style= TLF_CN_9;
    ods pdf file = "&analpath\Output\&pgmout._&outp._Blind.pdf" style= TLF_CN_9;
  
 
  proc report data=final nowindows center headline headskip missing split='|' spanrows;
	column  avisitn  order2 param2 trtg1 trtg2 trtg3 trtg4;
	    define avisitn   / order noprint;
	    define order2    / order noprint;
	    define param2 	 / order "Interferon-~{unicode gamma} ELISpot Spot-Forming Units (SFUs)" style(column)={just=left cellwidth=5.6in} flow style(header)={just=left font_size=9pt};
	    define trtg1     / display "1.0 " style(column)={asis=on just=center cellwidth=1.2 in} flow style(header)={just=center font_size=9pt};
	    define trtg2     / display "1" style(column)={asis=on just=center cellwidth=1.2 in} flow style(header)={just=center font_size=9pt};
	    define trtg3     / display "2.0" style(column)={asis=on just=center cellwidth=1.2 in} flow style(header)={just=center font_size=9pt};
	    define trtg4     / display "2" style(column)={asis=on just=center cellwidth=1.2in} flow style(header)={just=center font_size=9pt};


    break after param2/ skip;
	
    compute after param2 / style(lines)={font_size = 3pt};
/*      line " "; */
    endcomp;

  run;
ods _all_ close;
ods listing;

 

View solution in original post

1 REPLY 1
ballardw
Super User

If you are displaying text with leading spaces, not at all clear as NO DATA provided (pictures really don't count as can't program with pictures), try adding the style override of ASIS=on. You already have that for other variables, so I'm not sure why you don't for Param2. The ASIS=on maintains things like leading spaces in the output.

 


@HitmonTran wrote:

Hi,

 

I have a variable param2 that have values of:

data:

HitmonTran_0-1645031891480.png

As you can see there are indentations but when I output it in my pdf,   the indentation of "N, Median, Min-Max, etc." is lost.  Any idea on how to preserve the indenation?

 

output:

HitmonTran_1-1645032048216.png

 

code:

  ods results off;
ods listing close;
;

options formchar="|----|+|---+=|-/\<>*" ls=70 ps=70 missing = " " nodate nonumber center;

  options orientation=landscape;
   
  ods rtf file = "&analpath\Output\&pgmout._&outp._Blind.rtf" style= TLF_CN_9;
    ods pdf file = "&analpath\Output\&pgmout._&outp._Blind.pdf" style= TLF_CN_9;
  
 
  proc report data=final nowindows center headline headskip missing split='|' spanrows;
	column  avisitn  order2 param2 trtg1 trtg2 trtg3 trtg4;
	    define avisitn   / order noprint;
	    define order2    / order noprint;
	    define param2 	 / order "Interferon-~{unicode gamma} ELISpot Spot-Forming Units (SFUs)" style(column)={just=left cellwidth=5.6in} flow style(header)={just=left font_size=9pt};
	    define trtg1     / display "1.0 " style(column)={asis=on just=center cellwidth=1.2 in} flow style(header)={just=center font_size=9pt};
	    define trtg2     / display "1" style(column)={asis=on just=center cellwidth=1.2 in} flow style(header)={just=center font_size=9pt};
	    define trtg3     / display "2.0" style(column)={asis=on just=center cellwidth=1.2 in} flow style(header)={just=center font_size=9pt};
	    define trtg4     / display "2" style(column)={asis=on just=center cellwidth=1.2in} flow style(header)={just=center font_size=9pt};


    break after param2/ skip;
	
    compute after param2 / style(lines)={font_size = 3pt};
/*      line " "; */
    endcomp;

  run;
ods _all_ close;
ods listing;

 

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 563 views
  • 1 like
  • 2 in conversation