Using environment variables at run time with a DB2 stage
Posted: Wed Jul 23, 2008 12:20 pm
In DS Admin, I have setup a series of parameters, some of which will be passed to a DB2 stage to perform queries or loads.
In my job sequence, I bring in all the environment parms I need, and set them all to $PROJDEF, to fill in the value at run time for easier maintenance when changing things in Admin (we are on 7.5.2, so parameter sets cannot be used). An example here would be the $DB2_Owner (DB2 table owner used in queries, which for this example will be set to DAVE). There are similar variables for DB2 server name, userid and password.
For each job that is called, I set a parm to a name without the $ (eg: DB2_Owner) and in the job's properties/parameter tab, leave the field blank. This allows me to use #DB2_Owner# within the SQL statements vs. #$DB2_Owner# which does not work (various IBM CLI errors).
In the job sequence, the job activity/job tab lists the above field, and I set it to $DB2_Owner. I tried "$PROJDEF" and $PROJDEF here with no luck.
Is my solution to use the $ variables on the job activity screen ok or does anyone have a better idea? As a side note, why can't a #$<parm># be used in a DB2 stage like it can in other stages like sequental file?
In my job sequence, I bring in all the environment parms I need, and set them all to $PROJDEF, to fill in the value at run time for easier maintenance when changing things in Admin (we are on 7.5.2, so parameter sets cannot be used). An example here would be the $DB2_Owner (DB2 table owner used in queries, which for this example will be set to DAVE). There are similar variables for DB2 server name, userid and password.
For each job that is called, I set a parm to a name without the $ (eg: DB2_Owner) and in the job's properties/parameter tab, leave the field blank. This allows me to use #DB2_Owner# within the SQL statements vs. #$DB2_Owner# which does not work (various IBM CLI errors).
In the job sequence, the job activity/job tab lists the above field, and I set it to $DB2_Owner. I tried "$PROJDEF" and $PROJDEF here with no luck.
Is my solution to use the $ variables on the job activity screen ok or does anyone have a better idea? As a side note, why can't a #$<parm># be used in a DB2 stage like it can in other stages like sequental file?