BookmarkSubscribeRSS Feed
yonib
SAS Employee
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 ,
3 REPLIES 3
data_null__
Jade | Level 19
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]
Cynthia_sas
SAS Super FREQ
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
yonib
SAS Employee
Hi ,
Data _null_ thanks alot for your solution .

Cynthia thanks alot for the documentation .

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 3 replies
  • 571 views
  • 0 likes
  • 3 in conversation