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

Hello

I saw this code for proc report.

I have some questions please:

1-what is the meaning of writing  '_'  in column statement?

2-As I see this report is a displayed report (not summary report). 

Why do you think that the code writter decided to write "group" and not "Dispaly" (for the first 3 columns)? I see that in the report only in column country the repeated values are eliminated

3- Is the statement  "break after country / skip;"  create the break line that I marked in yellow?

Ronein_1-1668719146872.png

 

proc report data=test     nowd     headline    headskip   spacing=2     split='~';  
column (‘__’    country  lab  ptno  mon1);    
define   country / group    "Country" ; 
define   lab / group    "Lab~Test";    
define ptno / group    "Patient"   width=8;  
define mon1 / display   "Lab~Value"   width=5;    
break after country / skip;   
run; 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

One of the best ways to answer some of these questions is to make data set like that and run the code, or use similar options with a different data set.

The '__', or which ever characters are there, provides a heading row text above that of the column variable headers.

 

Group will display a value only once instead of on each row and provides provides a "sort" (the grouping) by that variable. The appearance of a group variable value one time makes it easier to see that the other columns are related somehow. Display will also just show data in the order of the data set by default.

See the difference between running these two reports:

 

proc report data=sashelp.class;
   column sex age;
   define sex /group;
   define age /display;
run;

proc report data=sashelp.class;
   column sex age;
   define sex /display;
   define age /display;
run;

 

 

 

The break after as shown will only appear in the LISTING destination. Since the Break is AFTER a variable it places break options after the last value of each group (or Order) variable, in this case the Country variable. Skip means the last bit of the break is a blank line, again only in the listing destination. So it provides a vertical white space after the last Canada and the last USA group of records.

 

View solution in original post

1 REPLY 1
ballardw
Super User

One of the best ways to answer some of these questions is to make data set like that and run the code, or use similar options with a different data set.

The '__', or which ever characters are there, provides a heading row text above that of the column variable headers.

 

Group will display a value only once instead of on each row and provides provides a "sort" (the grouping) by that variable. The appearance of a group variable value one time makes it easier to see that the other columns are related somehow. Display will also just show data in the order of the data set by default.

See the difference between running these two reports:

 

proc report data=sashelp.class;
   column sex age;
   define sex /group;
   define age /display;
run;

proc report data=sashelp.class;
   column sex age;
   define sex /display;
   define age /display;
run;

 

 

 

The break after as shown will only appear in the LISTING destination. Since the Break is AFTER a variable it places break options after the last value of each group (or Order) variable, in this case the Country variable. Skip means the last bit of the break is a blank line, again only in the listing destination. So it provides a vertical white space after the last Canada and the last USA group of records.

 

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 1 reply
  • 885 views
  • 0 likes
  • 2 in conversation