Thanks for your advise Mr Dick.
Obtain it and place it in a variable?
I did the same thing. I have stored the RCSTEP value trapped in STEPRC (rexx exec) and tried to use that variable in MAIN program,but still it is taking 'SPACES' as its value.
I am not able to pass the value of RCSTEP variable to MAIN program.
STEPRC EXEC
/* REXX STEPRC */
/* GET THE STEP NAME AND RETURN CODE */
NUMERIC DIGITS(32) /* ENSURE MAX PRECISION */
TCB=STORAGE(D2X(540),4) /* PSATOLD IN PSA */
JSCB =STORAGE(D2X(C2D(TCB)+180),4) /* TCBJSCB IN TCB */
JCT = STORAGE(D2X(C2D(JSCB)+261),3) /* JSCBJCTA IN JSCB */
THIS_STEP_NO = X2D(C2X(STORAGE(D2X(C2D(JSCB)+228),1)))
/* THIS STEP NO. */
FSCT = STORAGE(D2X(C2D(JCT)+48),3) /* JCTSDKAD IN JCT */
/* IS FIRST SCT */
TEMP_SCT = FSCT
DO I = 1 TO (THIS_STEP_NO - 1)
STEP = STORAGE(D2X(C2D(TEMP_SCT)+68),8)
RCSTEP = X2D(C2X(STORAGE(D2X(C2D(TEMP_SCT)+24),2)))
RCODE = RCSTEP ---------------- i stored in variable RCODE
EXIT
MAIN PROGRAM
/*Rexx program to ALLOCATE dataset*/
SAY" PROGRAM TO ALLOCATE DATASET AND INCREMENT VERSION"
INPUT1 ='G0100V00'
B = suBSTR(INPUT1,3,3)
SAY'SUBSTR' = B ---------------->100
DO 3 --------------------------------> JOB will run 3 times based on the condition of RC check below
QUEUE"//TCOM099A JOB (189),'ABHI',MSGCLASS = J,MSGLEVEL(1,1),
QUEUE"// PRTY=15,NOTIFY=TCOM099"
QUEUE"//STEP1 EXEC PGM = IEFBR14"
QUEUE"//DD1 DD DSN ="TCOM099.TEST.INPUT1",DISP=(NEW,CATLG,DELETE),"
QUEUE"// SPACE=(TRK,(5,10),RLSE),"
QUEUE"// DCB=(LRECL=80,BLKSIZE=800,RECFM=FB)"
.
.
.
"SUBMIT * END($$)"
/*********************************/
/*HERE I NEED THE JCL RETURN CODE*/
/*********************************/
IF
RCODE = 0 THEN NOP ----
RCODE is having value as SPACES since value is not passed and acting as a new variableELSE LEAVE
END
A = B+1 ------------------------> 101
INPUT1 = G0||A||V00
SAY'NEW INPUT IS' INPUT1 ----------> G0101V00
Any kind of help is highly appreciated.!!!