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

 I have a data that cannot group/order certain columns . Is it possible to group/order certain columns after the first 4 columns?

 

current code:

proc report data=final nowindows center headline headskip missing split='@';
    column trtan subjid aecat col:;
	define trtan   / order order=internal 	noprint;
	define subjid   / order order=internal 	noprint;
 

    define col1    / display style(column)={asis=on just=left cellwidth=.8in} flow style(header)={just=left font_size=9pt} "Subject"  ;
	define col2    / display style(column)={asis=on just=left cellwidth=.6in} flow style(header)={just=left font_size=9pt} "Age"  ;
	define col3    / display style(column)={asis=on just=left cellwidth=.3in} flow style(header)={just=left font_size=9pt} "Sex"  ;
	define col4    / display style(column)={asis=on just=left cellwidth=.65in} flow style(header)={just=left font_size=9pt} "Group"  ;
	define col5    / order style(column)={asis=on just=left cellwidth=1.2in} flow style(header)={just=left font_size=9pt} "SOC/PT"  ;
	define col6    / order style(column)={asis=on just=left cellwidth=1.2in} flow style(header)={just=left font_size=9pt} "Start Date"  ;

define col7 / order style(column)={asis=on just=left cellwidth=1.2in} flow style(header)={just=left font_size=9pt} "Severity" ;
define col8 / order style(column)={asis=on just=left cellwidth=1.2in} flow style(header)={just=left font_size=9pt} "Related" ; run;

 

data 

subject     age     sex     group     SOC/PT            start_date     Severity     Related
1           10      M       1         Fever/cough       01-01-2021     Mild         1
1           10      M       1         Fatigue/weak      01-02-2021     Mild         1
1           10      M       1         Gastro/pain       01-03-2021     Mild         2
 

want:

subject     age     sex     group     SOC/PT            start_date     Severity     Related
1           10      M       1         Fever/cough       01-01-2021     Mild         1
1           10      M       1         Fatigue/weak      01-02-2021     
1           10      M       1         Gastro/pain       01-03-2021                  2
1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

Hi:
You have most of the variables on the report row listed as DISPLAY variables except for the NOPRINT items and COL5 and COL6. I had to make some fake data and I don't know what all of your variables looked like, especially: TRTAL SUBJID and AECAT. But I was able to come close making some fake data as shown below:

Cynthia_sas_0-1620068927007.png


I did not bother to split the Soc_PT data cells because we covered that in one of your other postings.

Cynthia

View solution in original post

1 REPLY 1
Cynthia_sas
SAS Super FREQ

Hi:
You have most of the variables on the report row listed as DISPLAY variables except for the NOPRINT items and COL5 and COL6. I had to make some fake data and I don't know what all of your variables looked like, especially: TRTAL SUBJID and AECAT. But I was able to come close making some fake data as shown below:

Cynthia_sas_0-1620068927007.png


I did not bother to split the Soc_PT data cells because we covered that in one of your other postings.

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
  • 1 reply
  • 381 views
  • 2 likes
  • 2 in conversation