LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 1998, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 29 Oct 1998 11:34:50 -0800
Reply-To:   "Lanning, Chris" <clanning@AMGEN.COM>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   "Lanning, Chris" <clanning@AMGEN.COM>
Subject:   Re: Naming conventions for data files
Comments:   To: Lars Rud <lars_rud@LAAN-SPAR.DK>
Content-Type:   text/plain

I do not have to perform these kinds of procedures myself so I do know if my suggestions will be the best, but here goes anyway. What if you had one permanent data set where you kept track of the last date a file came in and the last data set number that was created. Then each time you get new data, read the data set just mentioned and assign the values in it to macro variables.

Maybe a little example....

In "Last":

data last; date=date(); /* Read in an ASCII file today */ lastdset = 0; /* Don't have any yet */

data _null_; set last; call symput('last', lastdset);

run;

%let next = %eval(&last + 1);

data data&next; infile .... input ....

Now you can use the last and next macro variables along with %eval and %let to grab the last three data sets or whatever. When finished just update your "Last" data set:

data last; lastdset=&next; date=date();

run;

Chris Lanning Trilogy Consultant clanning@amgen.com 1-805-447-0634 SAS Consulting is my life!!!

> ---------- > From: Lars Rud[SMTP:lars_rud@LAAN-SPAR.DK] > Reply To: Lars Rud > Sent: Thursday, October 29, 1998 4:26 AM > To: SAS-L@UGA.CC.UGA.EDU > Subject: Naming conventions for data files > > Hi, > > As a rank beginner, I am faced with a problem of establishing practical > naming conventions. > I get new data 3 times a month. Same filename and structure each time. > They arrive in ascii-files, and are read into SAS datasets. > Do any of you wizards have input for me on how I solve the following: > > I would like to run procedures and reports on the newest data. > In some cases just the latest datafile. > In other cases the 6 newest end-month data files > In yet other cases the latest group of 3 data files covering 1 full > calendar > month. > > > And the point: I am lazy. I do not want to change a comma in my programs > before running them. So the naming of the SAS datasets should make it > possible to accomplish all of the above in one fell swoop. > > Or maybe a procedure to be run after each update, to assign librefs to all > data sets? > > Is it possible? Or is SAS unsuitable for lazy people? > > Regards > > Lars >


Back to: Top of message | Previous page | Main SAS-L page