I'm not sure if this is the right forum section for this question, but direct me if I'm in the wrong place.
I've created a process to use SQL server to create a password and store it in a SQL table. Then I've created sas code to read the password value into a variable and then pass it along inside sas script to read a SPDS table.
Now I want to know if its possible to have the variable (and its return value) stored in autoexec, so I don't need to call the READ= code everytime I read a SPDS table.
Maybe I can use READ= value when I define libname inside autoexec?
=========================== Code ===========================
LIBNAME data sasspds host="sas01" serv="5190" user="spdsadm" ip=yes schema= "DATA" password="XXX" compress=yes;
/***********************************************************************/
/*** READ ***/
/*** code to auto pull read_key from SQL table ***/
/*** and read SPDS table content ***/
/***********************************************************************/
proc sql;
/* Put the resultset (1st row) into a varibale pw */
/* SAS PW is MAX 8 char long, here we take the 1st 8 Chars */
connect to odbc(uid=XXX pwd=XXX dsn="SQLServer03" );
select compress(read_key) into :r_pw from connection to odbc
(select top 1 read_key from DB..SAS_SPDS_KEY);
disconnect from odbc;
quit;
options symbolgen;
proc contents data= data.TABLE_1(read=&r_pw);
run;
proc contents data= data.TABLE_2(read=&r_pw);
run;
proc contents data= data.TABLE_3(read=&r_pw);
run;
....
/***********************************************************************/