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 ;
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:
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. |
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
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 ;
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 ;
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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.