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

Hello ALL,

i have data like

SUBJECTIDSITEIDPTSOC
SS0010001SS001COVID-19 pneumoniaInfections and infestations
SS0010002SS001Acute respiratory distress syndromeRespiratory, thoracic and mediastinal disorders

this is my data i want to print it in word by proc report like below

Site/

SubjectID

System Organ Class/

Preferred Term

MX001/

MX0010001

Infections and infestations/

COVID-19 pneumonia

MX001/

MX0010002

Respiratory, thoracic and mediastinal disorders/

Acute respiratory distress syndrome

I used flow option but it is not working for me.

1 ACCEPTED SOLUTION

Accepted Solutions
jay_bhavsar
Obsidian | Level 7

jay_bhavsar_0-1613967668509.png

Thank you so much for your reply i tried my best to explain my problem.

Yes this is i want to print new variable like this, but there is only one small addition that i want "/" symbol after each variable name 

i.e. 

Mary/

15/

F/

66.5/

112

 

Can i do this using proc report or in your code of "Catx".

View solution in original post

7 REPLIES 7
andreas_lds
Jade | Level 19

Please

  • post data in usable form
  • use exactly that data to show the expected output (i don't see "MX001/MX0010001" in your data)
  • post the code you are using as text using the running-man icon
jay_bhavsar
Obsidian | Level 7
Data i have

SUBJECTID SITEID PT SOC SUBSITE SOCPT AEYN
SS0010006 SS001 COVID-19 pneumonia Infections and infestations SS001/SS0010006 Infections and infestations/COVID-19 pneumonia Yes
SS0010006 SS001 Acute respiratory distress syndrome Respiratory, thoracic and mediastinal disorders SS001/SS0010006 Respiratory, thoracic and mediastinal disorders/Acute respiratory distress syndrome Yes
SS0010007 SS001 Sinus bradycardia Cardiac disorders SS001/SS0010007 Cardiac disorders/Sinus bradycardia Yes


proc report
data = ae2 center missing headline headskip nowd split = '|' spacing = 1;
column SUBSITE SOCPT AEYN ;

define SUBSITE /order order=internal width=30 "SUBJECT|SITE" flow ;
define SOCPT /order order=internal flow width=50 "SOC|PT" ;
define AEYN /order order=internal width=12 left "Collection|Date" ;

run;

Cynthia_sas
SAS Super FREQ

Hi:

  FLOW is only supported in the LISTING destination, or the OUTPUT window. The ODS destinations basically ignore the FLOW option. Without knowing what your full code is, it is only just a guess that you might do differently. However, review this previous post https://communities.sas.com/t5/ODS-and-Base-Reporting/Dynamic-column-width-in-proc-report-for-ODS-PD... there is some code in that posting that illustrates the use of WIDTH= as a style override that does for ODS destinations something similar to what FLOW does for the LISTING destination. Perhaps that will give you some ideas of how to proceed.

  Otherwise, you'll have to post your code in readable format, a program that reads your code and tell us your ODS destination of your final results. Other options you have like HEADLINE, HEADSKIP, SPACING and FLOW are all ignored by ODS RTF, ODS PDF, ODS HTML, ODS POWERPOINT and ODS EXCEL.

 

Cynthia

jay_bhavsar
Obsidian | Level 7

Thank you cynthia,

i just want to learn that 

if there is two variable system organ class and preferred term and in ods rtf output i want to present them as single variable separating by "/" and i want preferred term value in second line. 

Cynthia_sas
SAS Super FREQ

Hi:
Off hand it sounds like you might have to code for that. None of what you describe is clear to me from your tiny data example, What variable, for example is system organ class in your list of variables? What variable is preferred term? Here's an example of what I think you're describing using ODS RTF and a STYLE override for width since FLOW, HEADLINE, HEADSKIP, etc are all ignored by ODS RTF:

Cynthia_sas_0-1613745934105.png

Note that the ESCAPECHAR function {newline} needs to have the same ESCAPECHAR declared as the character (in this case, ^) used in the program.
Cynthia

jay_bhavsar
Obsidian | Level 7

jay_bhavsar_0-1613967668509.png

Thank you so much for your reply i tried my best to explain my problem.

Yes this is i want to print new variable like this, but there is only one small addition that i want "/" symbol after each variable name 

i.e. 

Mary/

15/

F/

66.5/

112

 

Can i do this using proc report or in your code of "Catx".

Cynthia_sas
SAS Super FREQ
Hi:
To do what you describe you need to change the way you concatenate the values together in the DATA step program (before PROC REPORT) so that the / is included at the end of each variable value.
Cynthia

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 7 replies
  • 1615 views
  • 0 likes
  • 3 in conversation