Hi,
Iam using the following jcl. It uses a REXX program to send mail.
Z/OS 1.8
What it has to do:
Delete datasets mentioned and mail to my mail box about the status.(STEP11 done - use STEP12 to send mail)
If datasets not deleted, mail to my mail box about the status. (STEP11 not done - use STEP13 to send mail)
The code:
//DELMAL JOB (PS),'PS-DELLIB',CLASS=A,MSGCLASS=X,NOTIFY=&SYSUID
//STEP11 EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
DELETE MELX.M700PCX.DATA02
DELETE MELX.M700PFX.DATA01
//*
//IFCONO IF (STEP11.RC = 0) THEN
//STEP12 EXEC PGM=IKJEFT01,REGION=6M
//SYSEXEC DD DISP=SHR,DSN=MOPE.ISPF.CMDTRG
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD DUMMY
//*
//SYSTSIN DD *
%EMAIL / -
SUBJ: Dataset deleted -
ADDR: alex.george@yahoo.com
TEXT: Datasets are deleted. Do check the output at mainframes.
//CONDE ELSE
//IFCONI IF (ABEND | STEP11.RC > 8) THEN
//STEP13 EXEC PGM=IKJEFT01,REGION=6M
//SYSEXEC DD DISP=SHR,DSN=MOPE.ISPF.CMDTRG
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD DUMMY
//*
//SYSTSIN DD *
%EMAIL / -
SUBJ: Error in Dataset deletion -
ADDR: alisha.taum@yahoo.com
TEXT: Datasets are not deleted. Do check the output at mainframes.
//ENDCONO ENDIF
//ENDCONI ENDIF
The output: (The datasets are not there, so STEP11 returned RC 8, that's fine). But i do not get the mail. Instead i see the following output in my SDSF.
DELMAL STEP11 - STEP WAS EXECUTED - COND CODE 0008
MELX.DELMAL.JOB50768.D0000104.? SYSOUT
MELX.DELMAL.JOB50768.D0000101.? SYSIN
STEP/STEP11 /START 2009106.2328
STEP/STEP11 /STOP 2009106.2328 CPU 0MIN 00.01SEC SRB 0MIN 00.00S
DELMAL STEP12 - STEP WAS NOT RUN BECAUSE OF CONDITIONAL EXPRESSION ON STATEMENT 5
DELMAL STEP12 - STEP WAS NOT EXECUTED.
STEP/STEP12 /START 2009106.2328
STEP/STEP12 /STOP 2009106.2328 CPU 0MIN 00.00SEC SRB 0MIN 00.00S
DELMAL STEP13 - STEP WAS NOT RUN BECAUSE OF CONDITIONAL EXPRESSION ON STATEMENT 12
DELMAL STEP13 - STEP WAS NOT EXECUTED.
STEP/STEP13 /START 2009106.2328
So when i checked for Statements 5 and 12, i see it contains the IF statement. (Shown below:)
1 //DELMAL JOB (PS),'PS-DELLIB',CLASS=A,MSGCLASS=
IEFC653I SUBSTITUTION JCL - (PS),'PS-DELLIB',CL
2 //STEP11 EXEC PGM=IDCAMS
3 //SYSPRINT DD SYSOUT=*
4 //SYSIN DD *
5 //IFCONO IF (STEP11.RC = 0) THEN
6 //STEP12 EXEC PGM=IKJEFT01,REGION=6M
7 //SYSEXEC DD DISP=SHR,DSN=XXX1.ISPF.CMDPROC
8 //SYSTSPRT DD SYSOUT=*
9 //SYSPRINT DD DUMMY
10 //SYSTSIN DD *
11 //CONDE ELSE
12 //IFCONDI IF (ABEND | STEP11.RC > 8) THEN
13 //STEP13 EXEC PGM=IKJEFT01,REGION=6M
14 //SYSEXEC DD DISP=SHR,DSN=XXX1.ISPF.CMDPROC
15 //SYSTSPRT DD SYSOUT=*
16 //SYSPRINT DD DUMMY
Can anyone point me the right direction?