The SAS Output Delivery System and reporting techniques

Proc print - report generating.

Accepted Solution Solved
Reply
N/A
Posts: 1
Accepted Solution

Proc print - report generating.

I'm trying to produce report as in the picture on the right, but I'm always getting pdf looking as in the first picture (by running the following code).

ods pdf file='D:\SAS_projekt.pdf';

options nodate nonumber;

title1 'Średni kwartalny zysk ze sprzedaży produktów z kategorii mebli';

proc print data=prdsale_polaczone_mean label noobs;

  id country year;

  var quarter actual_mean_meble;

run;

ods pdf close;

I tried using "BY" with variables "country" (label "Kraj") and "year" (label "Rok"), but I need to have all data in one table. Could somebody help me?

a.pngb.png


a.pngb.png

Accepted Solutions
Solution
‎05-25-2012 07:29 AM
Frequent Contributor
Posts: 95

Re: Proc print - report generating.

You can also get the desired output by using proc report instead of proc print.

Could you replace your proc print statement with the following proc report statement?

(I have tested it using sashelp.prdsale data set.)

Zafer

ods pdf file='D:\SAS_projekt.pdf';

options nodate nonumber;

title1 'Średni kwartalny zysk ze sprzedaży produktów z kategorii mebli';

proc report data=prdsale_polaczone_mean nowd;

  column Country Year quarter actual_mean_meble;

  define Country / group id;

  define Year / group id;

  define quarter / group id;

  define actual_mean_meble / analysis;

run;

ods pdf close;

View solution in original post


All Replies
Solution
‎05-25-2012 07:29 AM
Frequent Contributor
Posts: 95

Re: Proc print - report generating.

You can also get the desired output by using proc report instead of proc print.

Could you replace your proc print statement with the following proc report statement?

(I have tested it using sashelp.prdsale data set.)

Zafer

ods pdf file='D:\SAS_projekt.pdf';

options nodate nonumber;

title1 'Średni kwartalny zysk ze sprzedaży produktów z kategorii mebli';

proc report data=prdsale_polaczone_mean nowd;

  column Country Year quarter actual_mean_meble;

  define Country / group id;

  define Year / group id;

  define quarter / group id;

  define actual_mean_meble / analysis;

run;

ods pdf close;

Super User
Posts: 11,343

Re: Proc print - report generating.

Or

proc tabulate data=prdsale_polaczone_mean;

     class country year quarter;

     var actual_mean_meble;

     table country *year*quarter, actual_mean_meble * sum=''*f=$10.2;

run;

🔒 This topic is solved and locked.

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

Discussion stats
  • 2 replies
  • 267 views
  • 3 likes
  • 3 in conversation