DATA Step, Macro, Functions and more

Two or more PROC REPORT outputs in the same page (listing uotput)

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

Two or more PROC REPORT outputs in the same page (listing uotput)

[ Edited ]

Hi. I just start to learn SAS and I need some help with my problem.

I need to make listing output to a common text file. The output must contain outputs of few PROC REPORT steps, but some of them should be in the same page.

When I try to make such output with code like this:

 

ods listing file = 'c:\myfile';

proc report data = mydata1;

run;

 

proc report data = mydata2;

run;

ods listing close;

 

this two outputs are placed in the same file, but they are in different pages. Each output begins with new page. I tried to find more information anywhere, but withuot any results. Also ODS doesn't provide such options for LISTING output. So I'm confused a bit.

I need output like below in the same page:

 

Age (years)

 N	         xx
 Mean	         xx.x
 SD	         xx.xx
 Median	         xx.x
 Min	         xx
 Max	         xx

Age Group: N(%)

 >17-<=35	 xx (xxx.x%)
 >35-<=50	 xx (xxx.x%)
 >50-<=65	 xx (xxx.x%)
 >65	         xx (xxx.x%)

 

Maybe someone could help me to find the solution, or tell me easier way than ods.


Accepted Solutions
Solution
‎07-22-2016 11:00 AM
SAS Super FREQ
Posts: 8,864

Re: Two or more PROC REPORT outputs in the same page (listing uotput)

[ Edited ]

Hi:
I'm not sure why you need to produce this type of report in text file (which is what LISTING output is). It looks like a standard demographic report and most of my students use either PDF or RTF for this report type.

However, if you want to send output to the LISTING destination, specifically to a file, then you will need to do 2 things:
1) change your ODS LISTING statement to have a full path AND filename reference
and
2) investigate the option that puts a "page break" between each procedure output. For the LISTING destination, I believe it is the FORMDLIM or FORMDLM option. you'll have to look it up. (Right now, you are getting the default "carriage control" character inserted at the beginning of every procedure and you need to find the system option that will turn this off.)

cynthia

by full path and extension I mean that you need to change this to:
ods listing file = 'c:\myfile\report.lst'; OR
ods listing file = 'c:\myfile\report.txt';
... your code;
ods listing close;

View solution in original post


All Replies
Solution
‎07-22-2016 11:00 AM
SAS Super FREQ
Posts: 8,864

Re: Two or more PROC REPORT outputs in the same page (listing uotput)

[ Edited ]

Hi:
I'm not sure why you need to produce this type of report in text file (which is what LISTING output is). It looks like a standard demographic report and most of my students use either PDF or RTF for this report type.

However, if you want to send output to the LISTING destination, specifically to a file, then you will need to do 2 things:
1) change your ODS LISTING statement to have a full path AND filename reference
and
2) investigate the option that puts a "page break" between each procedure output. For the LISTING destination, I believe it is the FORMDLIM or FORMDLM option. you'll have to look it up. (Right now, you are getting the default "carriage control" character inserted at the beginning of every procedure and you need to find the system option that will turn this off.)

cynthia

by full path and extension I mean that you need to change this to:
ods listing file = 'c:\myfile\report.lst'; OR
ods listing file = 'c:\myfile\report.txt';
... your code;
ods listing close;

New Contributor
Posts: 2

Re: Two or more PROC REPORT outputs in the same page (listing uotput)

Posted in reply to Cynthia_sas

Thank you. It realy helped me.

Super User
Posts: 10,023

Re: Two or more PROC REPORT outputs in the same page (listing uotput)

You can use simple Data Step to get it .
☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 505 views
  • 1 like
  • 3 in conversation