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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

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