Date: Fri, 10 Dec 2004 20:23:15 GMT
Reply-To: Jeff Feeley <meithiweithi@YAHOO.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Jeff Feeley <meithiweithi@YAHOO.COM>
Organization: Astra Zeneca (astrazeneca.com)
Subject: Re: makefiles and SAS
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
I have done a little experimenting with using make with SAS. I have
used make extensively with C. We work on UNIX and hardly utilize its
features. The make utility would be especially useful for huge data
sets with millions of records. The current system my company uses is a
home grown thing that simply runs sas progs in the order the user puts
them in: Data first, tables and listings next. Trouble is if I want to
change "The" to "Them" in a single .lst file, one has to run all of the
the sas files all over again. Not efficient at all. Imagine sas files
that altogether take 24 hours to run. Make looks at file updates and
dependencies and only runs what is needed.
It does what it is supposed to do and works with SAS just fine. Here's
my make file (saschk is a little error checking shell script I wrote):
------------------------------------
create_rpt.lst: create_rpt.sas titles.sas test1.sas7bdat
sas create_rpt.sas
saschk create_rpt.log
test1.sas7bdat: manip_data.sas test0.sas7bdat
sas manip_data.sas
saschk manip_data.log
test0.sas7bdat: create_data.sas
sas create_data.sas
saschk create_data.log
ALL: create_data.sas test0.sas7bdat manip_data.sas test1.sas7bdat
titles.sas create_rpt.sas
sas create_data.sas
saschk create_data.log
sas manip_data.sas
saschk manip_data.log
sas create_rpt.sas
saschk create_rpt.log
Rusty Shackleford wrote:
> My office uses long chains of SAS programs to process some data that
> arrives in flat-file formats. We use shell scripts to automate the
> process. For example, a script might look like:
>
> sas prog1.sas
> sas prog2.sas
> sas prog3.sas
>
> Except that this would be about 40 steps long. Anyway, I've been
> experimenting with using makefiles to track dependencies so that if we
> edit prog2.sas, we only need to rerun everything following that.
>
> The makefile for the above three programs might look like:
>
> data1.sas7bdat: prog1.sas
> sas prog1.sas
>
> data2.sas7bdat: data1.sas7bdat prog2.sas
> sas prog2.sas
>
> data3.sas7bdat: data1.sas7bdat prog3.sas
> sas prog3.sas
>
> Then the user can type:
>
> make data3.sas7bdat
>
> And make will compare timestamps and figure out what needs to be run.
>
> Has anyone else done similar work?