Very sorry about that...you are right I used an underlying REXX driver module. Below is the module(GENJ) which generates the JCL >
/* REXX */
ADDRESS ISPEXEC
'VGET (JCL1 JCL2 JCL3 JCL4 JCL5) PROFILE'
'VGET (ODSN NDSN OP1 MYLIB) PROFILE'
'VGET (REPDSN) PROFILE'
JC1 = JCL1
JC2 = JCL2
JC3 = JCL3
JC4 = JCL4
JC5 = JCL5
ID=USERID()
I = 0
/* OPEN A TEMPORARY FILE TO STORE JCL */
"FTOPEN TEMP"
IF RC /= 0 THEN DO
"FTCLOSE"
"FTOPEN TEMP"
END
"FTINCL" JCARD
CALL GenerateJcl
"VGET ZTEMPF"
"FTCLOSE"
ADDRESS TSO "SUBMIT" "'"ZTEMPF"'"
IF RC = 0 THEN DO
JCLSTAT = 'COMPLETED'
'VPUT (JCLSTAT) PROFILE'
END
"LIBDEF ISPSLIB"
RETURN 0
GenerateJcl:
REXLIB = MYLIB
SELECT
WHEN OP1 = 2 THEN MYJCL = JOB1
END
"FTINCL" MYJCL
RETURN
The JCL is in the member JOB1. Here is the code >
//SUPERC EXEC PGM=ISRSUPC,
// PARM=(DELTAL,LINECMP,
// ' COBOL',
//NEWDD DD DSN=&NDSN,
// DISP=SHR
//OLDDD DD DSN=&ODSN,
// DISP=SHR
//OUTDD DD DSN=&ID..COMPARE.SUPERC,
// DISP=(MOD,CATLG),UNIT=SYSDA,
// SPACE=(0,(50,100),RLSE),
// DCB=(BLKSIZE=0)
//SYSIN DD DUMMY
//ISPF EXEC PGM=IKJEFT01,DYNAMNBR=25
//SYSEXEC DD DSN=&REXLIB,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
%PROCESS &ODSN &NDSN &REPDSN
//DEL EXEC PGM=IDCAMS
//SYSIN DD *
DELETE (&ID..COMPARE.SUPERC)
SET MAXCC=0
//SYSPRINT DD SYSOUT=*
Its giving error in GENJ....1st time working fine...without exiting screen running 2nd time giving RC4 in lines
"FTINCL" JCARD
and
ADDRESS TSO "SUBMIT" "'"ZTEMPF"'"
in GENJ