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;
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
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.