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?
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;
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;
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;
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
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.