Warm greetings!!
I have a doubt in using the TBADD TADSN in my program.
Scenario:
1. I have written FLAT File with the contents Example : From 1 to 16 it have a DATASET NAME and 21 to 30 it has an another DATASET NAME.
2. Now i need to pass this DATASET NAMES to the SKELETON JCL Via TBADD TADSN to execute the JCL Successfully.
"ALLOC F(INFLE) DSN('"SKUNZFLE"')SHR REU"
ADDRESS ISPEXEC "TBCREATE TADSN NAMES (SKD SEQ) NOWRITE REPLACE"
"EXECIO 1 DISKR INFLE"
do while (rc=0)
seq = seq + 1
pull SKD
SAY 'DATA PULLED : ' SKD
DSN1 = SUBSTR(SKD,1,16)
SAY 'DSN1 : ' DSN1
DSN2 = SUBSTR(SKD,21,30)
SAY 'DSN2 : ' DSN2
address ispexec "TBADD TADSN"
"EXECIO 1 DISKR INFLE"
end
ADDRESS ISPEXEC "TBCREATE TADSN NAMES (SKD SEQ) NOWRITE REPLACE"
"EXECIO 1 DISKR INFLE"
do while (rc=0)
seq = seq + 1
pull SKD
SAY 'DATA PULLED : ' SKD
DSN1 = SUBSTR(SKD,1,16)
SAY 'DSN1 : ' DSN1
DSN2 = SUBSTR(SKD,21,30)
SAY 'DSN2 : ' DSN2
address ispexec "TBADD TADSN"
"EXECIO 1 DISKR INFLE"
end
Issue:
1. If i execute the Program i am getting on the Last DATASET of the FILE (If i have 5 LINES of DATASET NAMES i am able to see only the LAST DATASET NAME in all the Dynamic steps executed).
SKELETON JCL :
)DOT TADSN
)IF &SEQ = 1 THEN
)DO
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=&DSN1,DISP=SHR
//.......
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=&SKDSN4,DISP=SHR
//DD01O DD DSN=&DSN2,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(10,5),RLSE),
// RECFM=VB,LRECL=2131
)IF &SEQ = 1 THEN
)DO
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=&DSN1,DISP=SHR
//.......
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=&SKDSN4,DISP=SHR
//DD01O DD DSN=&DSN2,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(10,5),RLSE),
// RECFM=VB,LRECL=2131
Expanded version:
Sequence 1 :
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=INPUT.D108,DISP=SHR
...
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=TEST.FILE,DISP=SHR
//DD01O DD DSN=OUTPUT.D108,
Sequence 2 :
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=INPUT.D108,DISP=SHR
...
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=TEST.FILE,DISP=SHR
//DD01O DD DSN=OUTPUT.D108,
Sequence 3 :
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=INPUT.D108,DISP=SHR
...
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=TEST.FILE,DISP=SHR
//DD01O DD DSN=OUTPUT.D108,
Sequence 4 :
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=INPUT.D108,DISP=SHR
...
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=TEST.FILE,DISP=SHR
//DD01O DD DSN=OUTPUT.D108,
Sequence 5 :
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=INPUT.D108,DISP=SHR
...
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=TEST.FILE,DISP=SHR
//DD01O DD DSN=OUTPUT.D108,
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=INPUT.D108,DISP=SHR
...
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=TEST.FILE,DISP=SHR
//DD01O DD DSN=OUTPUT.D108,
Sequence 2 :
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=INPUT.D108,DISP=SHR
...
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=TEST.FILE,DISP=SHR
//DD01O DD DSN=OUTPUT.D108,
Sequence 3 :
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=INPUT.D108,DISP=SHR
...
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=TEST.FILE,DISP=SHR
//DD01O DD DSN=OUTPUT.D108,
Sequence 4 :
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=INPUT.D108,DISP=SHR
...
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=TEST.FILE,DISP=SHR
//DD01O DD DSN=OUTPUT.D108,
Sequence 5 :
//STEP003 EXEC PGM=EZTPA00,REGION=4000K
//SYSSORT DD SYSOUT=*
//INFILE DD DSN=INPUT.D108,DISP=SHR
...
//STEP004 EXEC PGM=ABC
//DD01 DD DSN=TEST.FILE,DISP=SHR
//DD01O DD DSN=OUTPUT.D108,
Kindly let me know what was the wrong in this above code and educate me on this.
Thanks,
Ramsee