08-05-2016 05:40 AM
I have a programe which run both on EG and as a stored procedure. when I ran in EG in prod or Dev enviroment the libname automatically select the enviroment and ran the code, But when it is run as stored Procedure, it need to be change as manually for each enviroment.
I tried all option but not able to make the libname dynamic for Stored procedrue. Pls help me to suggest how to make dynamic code for libname in stored.
08-05-2016 05:55 AM
I would not change the library reference in the program.
Instead define the libraries in metadata with the same libref, but different paths. Then assign one definition to the prod stored process server and the other to the dev stored process server.
08-05-2016 07:50 AM
Assume you have two directories:
In SAS Management Console (Plug-Ins), open the Data Library Manager
Right-Click Libraries, select New Library
Name it XXX-Prod, on the next tab, assign it to the production server, in Options, give it the libref XXX, and set the path to /sasdata/xxxprod
Once you have finished, repeat the same, but name it XXX-Dev, assign it to the development server, and set the path to /sasdata/xxxdev
You now have a libref XXX in both production and development, which points to different paths, depending on the server context.
08-05-2016 08:08 AM
The SAS program will not need to do any changes to the library. But you will need separate stored process definitions for the prod and dev server, both pointing to the same physical SAS program file.
08-15-2016 12:44 AM