BookmarkSubscribeRSS Feed
MKSAS
Calcite | Level 5
HI,

I have a SAS shell dataset with a column listing ‘Outcomes’ and a ‘Total # of Outcomes’ column next to it. To produce a daily report, I need to populate the Total column based on another SAS dataset that will be updated daily. How do I go about doing this? What procedure would I use to do this? Proc tabulate?
2 REPLIES 2
statsplank
Calcite | Level 5
Hi MKSAS,

Here is an example that shows how you may "connect" two data sets:

data daily;
input ID $ Total_daily;
datalines;
01 9283778479
02 39850367
03 3587396
04 359839679
05 369839687
06 386739687
;

data shell;
input ID $;
datalines;
01
02
03
04
05
06
;

proc sort data=daily; by ID;
proc sort data=shell; by ID;

data shell(keep=ID Total);
merge shell daily(keep=ID Total_daily); by ID;
rename Total_daily=Total;
run;

proc print data=shell noobs;
run;
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
There are several techniques, some of which may be (depending on your input SAS dataset):

1) SAS PROC SQL to read your "another SAS dataset", summarize to daily totals and generate report.
2) SAS DATA step to read your "another SAS dataset", translate those SAS variables/columns to conform with your "SAS shell dataset", summarize to a "daily" totals SAS temporary file, and then generate a report, possibly using either PROC PRINT, PROC REPORT, DATA step?


It's undetermined if you intend to maintain some "running daily totals" from your stated "SAS shell datasets" or if you are in a position to use SAS code to re-read the daily files and create some weekly/month "totals" perspective in report-format.

Questions to ask are how/where is the SAS-generated output/report information to be hosted, in what format, and how will historical report versions to be maintained?
This information is just the start to developing a SAS-based application, given what you have explained thus far - a good start though.

The SAS support http://support.sas.com/ website has much information such as technical/conference papers and SAS-hosted documentation for reference and use.


Scott Barry
SBBWorks, Inc.

SAS 9.2 DOC: Reading, Combining, and Modifying SAS Data Sets
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001125856.htm

SAS 9.2 Documentation - referenced by topic category:
http://support.sas.com/cdlsearch?ct=80000

sas-innovate-2024.png

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.

 

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
  • 1175 views
  • 0 likes
  • 3 in conversation