Page 1 of 1

Forcing a job - which uses ISPF - to error

PostPosted: Tue Sep 22, 2009 2:45 am
by dohara
Hello

I run a rexx pgm - which uses ISPF - from batch and however in the rexx code there is error handling, no matter if CC12 is produced, my job still completes with CC0
I guess it might be because i call ISPF and it takes over the error handling process.. (?)
Is there a way to force my job to error if the rexx code generates CC12 ? instead of having CC0?

Thanks,
David

Re: Forcing a job - which uses ISPF - to error

PostPosted: Tue Sep 22, 2009 11:46 am
by expat
Where does the error occur and what are you trying to do at that point ?

Re: Forcing a job - which uses ISPF - to error

PostPosted: Tue Sep 22, 2009 2:37 pm
by dohara
Hi Expat

No matter where the error occurs i get CC0. For a test i run an EXIT 8 only.. with the same CC0 result.

Job that calls the rexx code:

//S002 EXEC PGM=IKJEFT01,DYNAMNBR=50
//SYSEXEC DD DSN=USERID.PROD.REXX,DISP=SHR
//ISPPLIB DD DSN=SYS1.SISPPENU,DISP=SHR
//ISPSLIB DD DSN=SYS1.SISPSENU,DISP=SHR
//ISPMLIB DD DSN=SYS1.SISPMENU,DISP=SHR
//ISPTLIB DD DSN=SYS1.SISPTENU,DISP=SHR
//ISPPROF DD DSN=&ISPPROF,
// DISP=(NEW,PASS),
// UNIT=VIO,
// SPACE=(TRK,(1,1,1)),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=6160)
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSTERM DD SYSOUT=*
//ISPCTL1 DD DUMMY
//ISPCTL2 DD DUMMY
//SYSIN DD DUMMY
//ISPLOG DD SYSOUT=*,DCB=(RECFM=VA,LRECL=125,BLKSIZE=129)
//SYSTSIN DD *
ISPSTART CMD(%REXTEST)
/*


REXTEST code:

/* REXX */
EXIT 8



It is only exiting with CC8 so i would expect my job to reflect to that but it does not.
In the output the following can be seen:

READY
ISPSTART CMD(%REXTEST)
ISPD117
The initially invoked CLIST ended with a return code = 8
READY

However, the job finishes with CC0

GSDMV20I JOBNAME- --STEP-- -PSTEP-- CCODE
GSDMV21I ISPFTEST S002 0



David

Re: Forcing a job - which uses ISPF - to error

PostPosted: Tue Sep 22, 2009 2:53 pm
by enrico-sorichetti
If   <your_error_condition_is_true> Then ,
   ZISPFRC = <Your_error_return_code>
Else ,
   ZISPFRC = 0
Address ISPEXEC "VPUT (ZISPFRC) SHARED "
Return 0

Re: Forcing a job - which uses ISPF - to error

PostPosted: Tue Sep 22, 2009 4:25 pm
by expat
For your test, try EXIT (8)

Re: Forcing a job - which uses ISPF - to error

PostPosted: Sat Sep 26, 2009 1:12 am
by dohara
Hello all

(8) did not work for me but what Enrico suggested is fine, eventually i found it in the ISPF guide
Thanks for your help.

David