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;
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.
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:
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.
FLOW, like, like HEADLINE, SKIP, HEADSKIP, DOL, DUL, etc is one of the LISTING only options.
cynthia
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!
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.