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;

 

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!
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
  • 1 reply
  • 430 views
  • 1 like
  • 2 in conversation