The SAS Output Delivery System and reporting techniques

Proc report help

Reply
Super Contributor
Posts: 266

Proc report help

Dear,

 

I need help in generating a listing report . I am attaching a screen shot of ouput needed. 

With my code I am not seeing all the variables in my output.  Also, I need help on  splitting the variable values . The split='/' in the program is working on variable labels, not on variable values. Please help. Thank you very much

 

 

data one;
input var1$ var2$ var3$ var4$ var5$ var6$ var7$ var8$ var9$;
datalines;
xxxx-xxxx/xx/F/W/xx/xxx xxxxxxxxxx/xxxxxxxxxxxxxxx/xxxxxxxxxxx yyyy-mm-dd(-xx)/yyyy-mm-dd(xx)/Y TI xxxx YES S:MildD:NotRelatedP:Related A:NoneOA:xxxxO:Recovered/ResolvedA:Other:xxxx F:xxxxx
;

 

ods rtf file="C:\\one.rtf" style=journal;
proc report data=adae1 nowd  CENTER style(header)=[just=center BORDERTOPWIDTH=2 BORDERBOTTOMWIDTH=2] 
		style(report)=[asis=on protectspecialchars=off Just=left outputwidth=9.25 in ]
		missing headline headskip nowd split='/' spacing=1;

column   var:;

define var1/order=internal width=8left "Subject ID/ Age/Gender/ Race/Region/Country";
define var2/order=internal width=8left "System Organ Class/
Preferred Term/
Verbatim Term 
" ;
define var3/order=internal width=8left "Start Date (Study Day)/
End date (Study Day)/TEAE  
" ;
define var4/order=internal width=8left "Onset Phase";
define var5/order=internal width=8left "Dose Level (mg)";
define var6/order=internal width=8left "SAE/
SAE Criteria 
";
define var7/order=internal width=8left "S: Severity
D: Relation to 
Study drug
P: Relation to Study Procedure
" ;
define var8/order=internal width=8left "A: Action Taken with Study Drug
OA: Other Action
O: Outcome 
" ;
define var9/order=internal width=8left "F:Frequency";
run;
ods rtf close;

 

 

SAS Super FREQ
Posts: 8,646

Re: Proc report help

Hi:
SPLIT= is designed only for header text, as a way to split the header value into multiple lines. SPLIT= is NOT designed for data values.

If you want to insert the equivalent of a carriage return or a line feed into a data cell, the easiest way is to use ODS ESCAPECHAR. There have been many previous posts about using ODS ESCAPECHAR...here's one https://communities.sas.com/t5/Base-SAS-Programming/Adding-a-line-feed-character-when-joining-two-co... and here's another: https://communities.sas.com/t5/ODS-and-Base-Reporting/Indent-different-rows-of-a-column-in-RTF/td-p/... and here's a third: https://communities.sas.com/t5/ODS-and-Base-Reporting/Re-Splitting-Word-in-Output/m-p/215009/highlig... and here: https://communities.sas.com/t5/ODS-and-Base-Reporting/Proc-report-creating-variable-number-of-line-s... and last, but not least, this one has your exact question: https://communities.sas.com/t5/ODS-and-Base-Reporting/Split-ODS-RTF-doesn-t-work/m-p/24831/highlight....

cynthia
New Contributor
Posts: 2

Re: Proc report help

Agree with Cynthia that the split= option only affect the header. But in proc report, you can use "flow" in the define statement to force the data value to wrap in the column when the splitor you defined in the proc report statement is met. Because flow option honors the split= option. Hope it helps.

SAS Super FREQ
Posts: 8,646

Re: Proc report help

Hi:

  Just a minor clarification. When you use FLOW with the SPLIT character the ONLY place it is respected in a DATA cell is in the LISTING destination. ODS destinations that use style (ODS HTML, for example) will NOT use the split character and FLOW.

 

  Here's what I mean. This program uses / in the data cell for name and you can compare the results below the program:

does_flow_work_ODS.png

 

  On the other hand, this program illustrates the use of ODS ESCAPECHAR to achieve the same result in ODS destinations that you can achieve in LISTING with FLOW.

ods_escapechar_used_in_HTML_not_LISTING.png

 

  FLOW, like, like HEADLINE, SKIP, HEADSKIP, DOL, DUL, etc is one of the LISTING only options.

 

cynthia

New Contributor
Posts: 2

Re: Proc report help

Thank you, Cynthia, for such a detailed clarification by comparing the two different approaches! Yes, I wasn't aware of the destination issue in the op. I'm also new to SAS and currently use proc report a lot to generate listing reports. Nice to know this and I will keep it in mind!

Post a Question
Discussion Stats
  • 4 replies
  • 135 views
  • 3 likes
  • 3 in conversation