Date: Fri, 12 Mar 2010 11:54:35 -0700
Reply-To: JD <jdiebal@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: JD <jdiebal@GMAIL.COM>
Subject: 'Relative' %include statements to assign libraries.
Content-Type: text/plain; charset=ISO-8859-1
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.
I'm possibly resubmitting this. I did not get a copy the first time and
thought maybe something didn't go thru. Hopefully this isn't simply a
duplicate being added it.
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.