Read the bottom as to your issue but let me ramble first...
I didn't say the file on the insert is a dummy file
I said get rid of the dummy file as in replace
0100.00 RUNSQL SQL('insert into NBJDTA.HRCTRLFP (select +
0101.00 nbjdta.HIRADINTERFACENAMESHPD, +
0102.00 nbjdta.HIRADFILENAMESHPD, +
0103.00 nbjdta.HIRADAS400FILENAMESHPD, +
0104.00 nbjdta.HIRADBATCH#SHPD, +
0105.00 nbjdta.HIRADSTATUSSHPD, +
0106.00 nbjdta.HIRADBATCHTIMESTAMPSHPD, +
0107.00 nbjdta.HIRADODITIMESTAMPSHPD from +
0108.00 SYSIBM.SYSDUMMY1)') COMMIT(*NONE)
With
0100.00 RUNSQL SQL('insert into NBJDTA.HRCTRLFP ( +
0101.00 col1, col2, col3, col4, col5, col6, col6
0102.00 values (
0101.00 nbjdta.HIRADINTERFACENAMESHPD, +
0102.00 nbjdta.HIRADFILENAMESHPD, +
0103.00 nbjdta.HIRADAS400FILENAMESHPD, +
0104.00 nbjdta.HIRADBATCH#SHPD, +
0105.00 nbjdta.HIRADSTATUSSHPD, +
0106.00 nbjdta.HIRADBATCHTIMESTAMPSHPD, +
0107.00 nbjdta.HIRADODITIMESTAMPSHPD +
0108.00 )') COMMIT(*NONE)
But, let's see if your variables exist:
select *
from qsys2.sysvariables
where variable_schema='ROB'
;
Pick one and display the contents with:
Values rob. HIRADAS400FILENAMESHPD
There's no reason (for this process) to use SYSDUMMY1. It brings nothing to the party.
WHAT THE ISSUE IS:
<snip>
Session scope: Global variables have a session scope. This means that although they are available to all sessions that are active on the database, their value is private for each session.
</snip>
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/db2/rbafzcvariable.htm
If I created that variable with Run SQL Scripts and then I go into STRSQL and do
Values rob. HIRADAS400FILENAMESHPD
I get a null value.
So now you are probably wondering: What is the definition of a session scope? A job? What?
Good luck with that exercise.
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.