BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
HitmonTran
Pyrite | Level 9

Hi,

 

my output is displaying 'System Organ Class' for every row when I only want to display it for the first row per SOC. 

 

It works (display only once) when I don't use variable 'seq'. However, when that is added, it stop working.

 

 current:

HitmonTran_0-1660605556260.png

 

 

want:

HitmonTran_1-1660605755218.png

 

data:

      

MHSOCMHPTSEQ 
Total 1 
Blood and lymphatic system disordersTotal2 
Blood and lymphatic system disordersAnaemia3 
Cardiac disordersTotal4 
Cardiac disordersAngina pectoris5 
Cardiac disordersAtrial fibrillation6 
Cardiac disordersAtrial flutter7 
Cardiac disordersCardiac failure8 
Cardiac disordersMyocardial infarction9 
Cardiac disordersMyocardial ischaemia10 
Congenital, familial and genetic disordersTotal11 
Congenital, familial and genetic disordersGilbert's syndrome12 
Congenital, familial and genetic disordersHereditary non-polyposis colorectal cancer syndrome13 
Endocrine disordersTotal14 
Endocrine disordersGoitre15 
Endocrine disordersHyperparathyroidism16 
Endocrine disordersHyperthyroidism17 
Endocrine disordersHypothyroidism18 
Endocrine disordersTesticular failure19 
Endocrine disordersThyroid disorder20 
Endocrine disordersThyroid mass21 
Eye disordersTotal22 
Eye disordersCataract23 
Eye disordersDiabetic retinopathy24 
Eye disordersPterygium25 
Eye disordersRetinopathy hypertensive26 
    

 

ods rtf file="&analydir.\Output\t_3_mh.rtf" style=rtf_box ;*rtf_fda ;
ods escapechar='^';
 
proc report nowd headline headskip split='|' data=allmh2 spacing=2 missing spanrows style(report)=[rules=groups frame=hsides]; cols seq mhsoc mhpt Thoracic Urologic ENT total; define seq /order noprint; define mhsoc / order 'System Organ Class' left style(column)={cellwidth=2.5in} style(header)=[just=left]; define mhpt / order 'Preferred Term' left style(column)={cellwidth=2.5in} style(header)=[just=left]; define Thoracic / display "_Thoracic_|(n=&eth)" center style(column)={cellwidth=1.2in}; define Urologic / display "_Urologic_|(n=&comp)" center style(column)={cellwidth=1.2in}; define ENT / display "_ENT_|(n=&compd)" center style(column)={cellwidth=1.2in}; define total / display "_Total_| (n=&stot)" center style(column)={cellwidth=1.2in}; compute after mhsoc/style={fontsize=2pt just=left}; line " "; endcomp; compute after _page_; line @1 " "; endcomp; run;

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

You cannot have an ORDER variable before the GROUP variable.

Try not using SEQ in the report.

Instead make sure the data is sorted by SEQ and use ORDER=DATA option on the System Organ Class.

define mhsoc / group order=data ....

View solution in original post

5 REPLIES 5
SASKiwi
PROC Star

Try defining SEQ and MHSOC as GROUP columns rather than ORDER ones. 

HitmonTran
Pyrite | Level 9
still doesn't work. same results
Tom
Super User Tom
Super User

You cannot have an ORDER variable before the GROUP variable.

Try not using SEQ in the report.

Instead make sure the data is sorted by SEQ and use ORDER=DATA option on the System Organ Class.

define mhsoc / group order=data ....
Cynthia_sas
SAS Super FREQ

Hi:
It might also work to put SEQ after MHSOC in the COLUMN statement:
column mhsoc seq mhpt Thoracic Urologic ENT total;
You can still NOPRINT on SEQ and it should force the order you want within each value of MHSOC.
Cynthia

SASKiwi
PROC Star

Yes, just realised that SEQ can't group because the value changes for each row. Try @Tom 's solution and don't use SEQ.

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
  • 5 replies
  • 734 views
  • 0 likes
  • 4 in conversation