I have a SQL query which needs parameters in where clause. I need to pass parameters from sas data set. Can I do this with "PROC DB2EXT IN=EMPLIST" where EMPLIST is sas dataset.
Ex: I have to read employee details from the db2 table for all the EMPNO in sas data set. Can someone advice me if I can do this with PROC DB2EXT? My query looks like this:
Select emp_name, emp_status from EMPLOYEE
WHERE Employee_NO = '%(&EMPLIST.EMPNO)' ;
When I need to select accounts from a large DB2 table, I pass the account numbers that I have in a sas dataset using a proc format. I make sure I have one records per account, so I sort the data using the nodupkey option, then setup the sql like below.
other sas code that reads the accounts ...
PROC SORT DATA=ACCOUNTS OUT=NUM(KEEP=NUMBER) NODUPKEY;
DATA TEMP (KEEP = FMTNAME TYPE LABEL START);