Hi there,
Simple question.
I have dataset which contains 10 observations.
I am using ODS PDF to create PDF file.
OPTIONS ORIENTATION=landscape NODATE papersize=A1 linesize=max pagesize=max leftmargin=0.5in NODATE NOCENTER MISSING=" "
formchar="|----|+|---+=|-/\<>*";
ods pdf file="&path..pdf";
proc report data=work.output;
run;
ods pdf close;
this produces only 1 observation. However when I use proc print it correctly produces 10 records. what could be the issue? Any help is really appreciated
Hi:
I am guessing you are seeing something like #1 vs #2 in the screen shot below:
Here's the test code.
data testdata;
infile datalines;
input id amount;
datalines;
100 15
200 22
300 35
400 41
500 58
;
run;
proc print data=testdata;
title '1) with a PROC PRINT detail report you see all 5 obs';
run;
proc report data=testdata;
title '2) with all numeric variables, the PROC REPORT default';
title2 'is to summarize -- so you only see 1 row';
run;
proc report data=testdata;
title '3) To see detailed rows with PROC REPORT, provide a usage for numeric variables';
column id amount;
define id / order;
define amount / sum;
run;
My guess is you need to switch to code like #3 report and provide a usage for a numeric variable or you need to add a GROUP or ORDER variable to the PROC REPORT code.
cynthia
Please include your log in the post.
Below is log when using Proc report
24
25 GOPTIONS ACCESSIBLE;
26
27 OPTIONS ORIENTATION=landscape NODATE papersize=A1 linesize=max pagesize=max leftmargin=0.5in NODATE NOCENTER MISSING=" "
28 formchar="|----|+|---+=|-/\<>*";
29 ods pdf file="&path..pdf";
NOTE: Writing ODS PDF output to DISK destination "/data/Comparison.pdf.pdf", printer "PDF".
30 proc report data=work.output;
31 run;
NOTE: There were 24 observations read from the data set WORK.OUTPUT.
NOTE: PROCEDURE REPORT used (Total process time):
real time 0.02 seconds
cpu time 0.03 seconds
32 ods pdf close;
NOTE: ODS PDF printed 1 page to /data/Comparison.pdf.pdf.
And below is using Proc print
25 GOPTIONS ACCESSIBLE;
26 OPTIONS ORIENTATION=landscape NODATE papersize=A1 linesize=max pagesize=max leftmargin=0.5in NODATE NOCENTER MISSING=" "
27 formchar="|----|+|---+=|-/\<>*";
28 ods pdf file="&path..pdf";
NOTE: Writing ODS PDF output to DISK destination "/data/Comparison.pdf.pdf", printer "PDF".
29 proc print data=work.output;
30 run;
NOTE: There were 24 observations read from the data set WORK.OUTPUT.
NOTE: PROCEDURE PRINT used (Total process time):
real time 0.05 seconds
cpu time 0.05 seconds
31 ods pdf close;
NOTE: ODS PDF printed 1 page to /data/Comparison.pdf.pdf.
They both show 24 records read. Can you please re-run that with a SASHELP dataset, such as CARS and post the PDF/HTML that's truncated and the log.
If the issue isnt replicated with a SASHELP data set then it's likely an issue with the data somehow.
Hi:
I am guessing you are seeing something like #1 vs #2 in the screen shot below:
Here's the test code.
data testdata;
infile datalines;
input id amount;
datalines;
100 15
200 22
300 35
400 41
500 58
;
run;
proc print data=testdata;
title '1) with a PROC PRINT detail report you see all 5 obs';
run;
proc report data=testdata;
title '2) with all numeric variables, the PROC REPORT default';
title2 'is to summarize -- so you only see 1 row';
run;
proc report data=testdata;
title '3) To see detailed rows with PROC REPORT, provide a usage for numeric variables';
column id amount;
define id / order;
define amount / sum;
run;
My guess is you need to switch to code like #3 report and provide a usage for a numeric variable or you need to add a GROUP or ORDER variable to the PROC REPORT code.
cynthia
Perfect. All columns are numeric ...And thats why this problem. Thanks a lot
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.