BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

In this code I am using BREAK AFTER statement with the SKIP option in order to add a blank line  after each group of rows with the same value .

I don't know why but in the output  that appears in "Results" window there id no blank line between values of age

why??

 
proc report data=sashelp.class nowd headskip ;
column sex name age ;   
define sex / order width=3 ; 
break after sex / skip ; 
title2 'PROC REPORT' ;
run ; 
5 REPLIES 5
Kurt_Bremser
Super User

There is a blank line after each "sex" group, but only for the "Listing" destination:

      PROC REPORT

Sex  Name            Age
                        
F    Alice            13
     Barbara          13
     Carol            14
     Jane             12
     Janet            15
     Joyce            11
     Judy             14
     Louise           12
     Mary             15
                        
M    Alfred           14
     Henry            14
     James            12
     Jeffrey          13
     John             12
     Philip           16
     Robert           12
     Ronald           15
     Thomas           11
     William          15

Maxim 1: Read the documentation.

From the documentation of the BREAK statement:

SKIP

writes a blank line for the last break line.

Restriction This option affects only the LISTING output. It has no affect on other ODS output.
Ronein
Meteorite | Level 14

Thank you

2 questions please:

1-May you show please how to open "Listing" destination?(What code should I write)

2-Is there a way to create the empty line in Results window destination? (What code should I write)

Joe

Kurt_Bremser
Super User

Google (see Maxim 6) gave me the hont to use a compute block:

proc report data=sashelp.class nowd headskip ;
column sex name age ;   
define sex / order width=3 ; 
compute after sex/style=Default;
  line "";
endcomp; 
title2 'PROC REPORT' ;
run ; 
Ronein
Meteorite | Level 14

Is it listing destination in your last code?

How can I know that destination of out put is "listing"?

proc report data=sashelp.class nowd headskip ;
column sex name age ;   
define sex / order width=3 ;
 
compute after sex/style=Default;
  line "";
endcomp; 

run ;

Kurt_Bremser
Super User

The line statement in the compute block works in all destinations.

 

Which ODS destination is active is controlled by your code, either by code you write, or by code that is sent from EG according to the options set in Tools - Options - Results. Look into the log, and you'll see the ODS statements:

14         ODS LISTING GPATH=&sasworklocation;
15         FILENAME EGSR TEMP;
16         ODS tagsets.sasreport13(ID=EGSR) FILE=EGSR
17             STYLE=Default
18             STYLESHEET=(URL="file:///C:/Program%20Files%20(x86)/SASHome/x86/SASEnterpriseGuide/7.1/Styles/Default.css")
19             NOGTITLE
20             NOGFOOTNOTE
21             GPATH=&sasworklocation
22             ENCODING=UTF8
23             options(rolap="on")
24         ;

is the log from code sent from EG when SAS Report and Listing destinations are active in the EG settings.

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
  • 14665 views
  • 0 likes
  • 2 in conversation