BookmarkSubscribeRSS Feed
Nooby1Konoby
Calcite | Level 5
Hi everyone; I'm a SAS rookie. I am using BASE SAS 9.2 and I've run into a problem. I have two mainframe data sets that I am trying read in and manipulate the data via columns. Would anyone know a simple way to use PROC REPORT or another method to manipulate the below data so that it shows the below

STORNAME ALLOC ALLOC
SEP09 DEC08
DATADB2 10.37 9.30


INPUT DATA

STORNAME ALLOC DATE
DATADB2 10.37 SEP09
DATAIMS 2.07 SEP09
EPOL 14.13 SEP09
FC DASD 50.46 SEP09
G1 23.87 SEP09
G2 4.31 SEP09
G3 33.08 SEP09
OBJDATA 2.11 SEP09
SYSTEMS 2.32 SEP09
XTVOLS 0.26 SEP09

STORNAME ALLOC DATE
DATADB2 9.30 DEC08
DATAIMS 2.20 DEC08
EPOL 27.50 DEC08
FC DASD 25.90 DEC08
G1 20.30 DEC08
G2 3.50 DEC08
G3 31.30 DEC08
OBJDATA 2.00 DEC08
SYSTEMS 4.40 DEC08
XTVOLS 0.26 DEC08
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
SAS PROC REPORT with the GROUP and ACROSS options can create the report you demonstrated.

The Google advanced search argument will generate some matches, providing you SAS-hosted documentation and supplemental technical/conference references:

proc report group across site:sas.com


Scott Barry
SBBWorks, Inc.
Cynthia_sas
SAS Super FREQ
Hi:
First of all, PROC REPORT will not append your two data sets together. For PROC REPORT, it's one data set in and a report comes out. PROC REPORT will not do any "reading in" of multiple data sets. You'll have to do that with a DATA STEP program, PROC APPEND or PROC SQL.

However, what you want after the data sets are together, you could do with either PROC REPORT or PROC TABULATE. If you use PROC REPORT, then your DATE would be an ACROSS usage nested with ALLOC (DATE,ALLOC) and if you use PROC TABULATE, then DATE would be crossed with ALLOC (DATE*ALLOC) in the COLUMN dimension. Whether you use REPORT or TABULATE really depends on what other processing, if any, you need to do on your report. Grand Totals?? Sub Totals??? Calculated items??

A good place to start would be to look at some examples of PROC REPORT and PROC TABULATE in the documentation. There are a lot of examples to learn from. In addition, there have been many, many user group papers and forum postings on the topic of PROC REPORT and PROC TABULATE. Using all of those resources should give you some good code samples and some ideas of whether REPORT or TABULATE is the right choice.

cynthia

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
  • 2 replies
  • 596 views
  • 0 likes
  • 3 in conversation