|
an autoexec is the way to handle assigning global statements like
filename and libname
Batch Processing under Windows
TinyUrl: http://tinyurl.com/6zlqoh
http://www.sascommunity.org/wiki/Batch_processing_under_Windows
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
> -----Original Message-----
> From: owner-sas-l@listserv.uga.edu [mailto:owner-sas-
> l@listserv.uga.edu] On Behalf Of JD
> Sent: Friday, March 12, 2010 11:07 AM
> To: sas-l
> Subject: 'Relative' %include statements to assign libraries.
>
> Need:
> I have sas jobs that need to be tested. The jobs in the test folder
> will
> point to test libraries.
> I will then move those jobs to a production folder where they will
> point to
> production libraries. I do not want to change the libnames when moving
> it.
> Rather I'd like to simply put a libnameAssignment.sas file pointing to
> test
> libs in one and same file name pointing to production libs in the
> other.
> Then, if the SAS job had a "%include" with relative references
pointing
> to
> the libNames.sas file, the job could be moved with no changes.
>
> There are probably better ways to do the above so feel free to ignore
> everything after this line if there is a good, standard method of
doing
> this
> already. thanks in advance
>
>
>
> If I set my environment variable to something like:
>
> Variable Name: tempProd
>
> Variable value: c:\
>
>
>
> And then put the batch job and libname.sas program in the
"C:\TempProd"
> folder and kick off the job, it works.
>
>
>
> Here is the batch job:
>
> %include '..\tempProd\libNames.sas';
>
> sas code
>
> .
>
> .
>
> .
>
> sascode
>
>
>
> Here is the contents of the libNames.sas file (which will change
> depending
> if it is in the Test or Prod folder):
>
> libname dmApp odbc dsn=datamart18 schema='APP' insertbuff = 2000;
>
>
>
> libname C520 odbc dsn=datamart schema='C520' ;
>
>
>
> My problem is that the jobs will not reside on the 'C' drive. They
will
> reside on a network drive somewhere. If I could put that network path
> in the
> Variable Name in the environment variable it would work but it doesn't
> recognize it. I'm guessing that the enviornment variable is only good
> for
> the PC the SAS system is loaded on.
|