Help using Base SAS procedures

Proc report question

Reply
SAS Employee
Posts: 105

Proc report question

Hi , I have this simple code :

proc report data=sales nowindows;
column name zip sales;
define name / group;
define zip/group;
define sales/sum format=6.2;
run;

The ouput is html.
e.g :
jonatan 6061 200
8080 400
jeni 2020 700
3040 800

My question :
Is it possible to generate output like this :
jonatan 6061 200
jonatan 8080 400
jeni 2020 700
jeni 3040 800

I tried to find a solution on the web and i couldnt find...
Any suggestions?

Thanks in advance ,
Respected Advisor
Posts: 3,799

Re: Proc report question

This works but there may be a better way,

[pre]
data sales;
input name $ zip sales;
cards;
jonatan 6061 200
jonatan 8080 400
jeni 2020 700
jeni 3040 800
;;;;
run;
proc report data=sales nowindows list;
column name name=name2 zip sales;
define name / group noprint;
define name2 / group;
define zip / group;
define sales/sum format=6.2;

compute before name;
savename=name;
endcomp;

compute name2;
name2 = savename;
endcomp;
run;
[/pre]
SAS Super FREQ
Posts: 8,866

Re: Proc report question

Posted in reply to data_null__
Hi:
My only suggestion would be to modify the COMPUTE block for NAME2 to be:
[pre]
compute name2 / character length=10;
name2 = savename;
endcomp;
[/pre]

So that you explicitly get the length you want.

For more information on PROC REPORT, these are good resources that will supplement the documentation:
http://support.sas.com/documentation/onlinedoc/v82/techreport_p258.pdf (the "original" NOWD (non-window) mode manual -- still good after all these years)

Other TS papers:
http://support.sas.com/resources/papers/ProcReportBasics.pdf
http://support.sas.com/rnd/papers/sgf07/sgf2007-report.pdf

User Group papers:
http://www2.sas.com/proceedings/sugi31/235-31.pdf
http://www2.sas.com/proceedings/sugi30/244-30.pdf

cynthia
SAS Employee
Posts: 105

Re: Proc report question

Hi ,
Data _null_ thanks alot for your solution .

Cynthia thanks alot for the documentation .
Ask a Question
Discussion stats
  • 3 replies
  • 110 views
  • 0 likes
  • 3 in conversation