IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to set return code in the JCL which has ISPF commands


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kishpra

New User


Joined: 24 May 2010
Posts: 92
Location: Pune

PostPosted: Mon Mar 14, 2011 3:10 pm
Reply with quote

Hi ,

I am creating a dynamic JCL using the below REXX program :

"ISPEXEC LIBDEF ISPSLIB DATASET ID('ITA.TEST.M1')"
"ISPEXEC LIBDEF ISPFILE DATASET ID('ITA.TEST.M2')"

"ALLOC DA('ITA.TEST.M3') F(INPUT) SHR REUSE"
"EXECIO * DISKR INPUT (STEM LINES. FINIS)"
"ISPEXEC FTINCL REXXDULB"
K = 0
DO I = 1 TO LINES.0
PARSE VAR LINES.I VAR1 VAR2

OLDDSN1 = VAR2

IF VAR1 = 'MTRKJNL' THEN
DO
OLDDSN = 'ITA.TEST.'
NEWDSN = 'ITA.TEST.KISH'
END
ELSE
IF VAR1 = 'MTRKDTE' THEN
DO
OLDDSN = 'ITA.TEST.'
NEWDSN = 'ITA.TEST.MAS'
END
ELSE
Set Return-Code as 8 and fail the JCL with MAXCC=8

"ISPEXEC FTOPEN "
"ISPEXEC FTINCL REXXDULA"

END
"ISPEXEC FTCLOSE"
ADDRESS TSO
SUB "'ITA.TEST.M2'"
"FREE F(INPUT)"

EXIT


I mean to say If VAR1 is not equal to 'MTRKJNL' or 'MTRKDTE' ,the JCL to submit the above REXX program as below should fail with MAXCC=8


//ATCH EXEC PGM=IKJEFT01,DYNAMNBR=1500
//SYSTSPRT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//ISPLOG DD SYSOUT=*,DCB=(RECFM=VA,LRECL=125,BLKSIZE=129)
//ISPPROF DD DSN=,DISP=(NEW,DELETE),UNIT=SYSDA,
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=3120,DSORG=PO),
// SPACE=(3120,(20,5,10))
//ISPMLIB DD DISP=SHR,DSN=
//ISPPLIB DD DISP=SHR,DSN=
//ISPTLIB DD DISP=SHR,DSN=
//ISPTABL DD DSN=,DISP=(NEW,DELETE),UNIT=SYSDA,
//ISPSLIB DD DISP=SHR,DSN=ITA.REXX.TEMP
//SYSPROC DD DISP=SHR,DSN=ITA.TEST.TEMP.F1
//SYSTSIN DD *
ISPSTART CMD(REXX1)
/*


Thanks!
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Mar 14, 2011 4:49 pm
Reply with quote

This is reasonably well documented in the manuals.

What did you find that you did not understand.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Mon Mar 14, 2011 5:59 pm
Reply with quote

Search for ZISPFRC in the Dialog Developer's book.

O.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Mon Mar 14, 2011 6:23 pm
Reply with quote

Or perhaps you need to use IKJEFT1A instead IKJEFT01
Back to top
View user's profile Send private message
kishpra

New User


Joined: 24 May 2010
Posts: 92
Location: Pune

PostPosted: Tue Mar 15, 2011 11:28 am
Reply with quote

When I am setting the Return-Code in the Else part,it works fine.But the JCL runs with MAXCC=0.In the spool it writes,clist failed with MAXCC=8.




Thanks!
Back to top
View user's profile Send private message
kishpra

New User


Joined: 24 May 2010
Posts: 92
Location: Pune

PostPosted: Tue Mar 15, 2011 11:53 am
Reply with quote

Thanks!

The below code is working fine with -

ZISPFRC = 16
ADDRESS ISPEXEC "VPUT (ZISPFRC)"
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Mar 15, 2011 11:54 am
Reply with quote

IKJEFT01 returns 0 as that is the return code of IKJEFT01. If you want the return code of what was executed by IKJEFTxx then use 1A as stated above.
Back to top
View user's profile Send private message
parsesource

New User


Joined: 06 Feb 2006
Posts: 97

PostPosted: Tue Apr 05, 2011 2:27 am
Reply with quote

Nic Clouston wrote:
IKJEFT01 returns 0 as that is the return code of IKJEFT01. If you want the return code of what was executed by IKJEFTxx then use 1A as stated above.


this is wrong. ikjeft01 returns the last command return code.

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4C210/3.4.4.1.2?SHELF=&DT=20010706115428&CASE=
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1788
Location: Bloomington, IL

PostPosted: Tue Apr 05, 2011 2:32 am
Reply with quote

parsesource wrote:
Nic Clouston wrote:
IKJEFT01 returns 0 as that is the return code of IKJEFT01. If you want the return code of what was executed by IKJEFTxx then use 1A as stated above.


this is wrong. ikjeft01 returns the last command return code.

publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/IKJ4C210/3.4.4.1.2?SHELF=&DT=20010706115428&CASE=

Untrue; this is stated nowhere in the manual, nor does it correspond with reality.
Back to top
View user's profile Send private message
nevilh

Active User


Joined: 01 Sep 2006
Posts: 262

PostPosted: Tue Apr 05, 2011 1:28 pm
Reply with quote

Quote:
ikjeft01 returns the last command return code.

I agree I have just spent a day testing this on a 1.12 system and the latest manual states quite clearly
Quote:
The return code from |the next command replaces the return code. The return code returned by the |batch IKJEFT01 job (which is the job condition code) is basically the return |code of the last command that has been executed, so the IKJEFT01 return code |(such as a job condition code) is the rolling return code from each command |invoked with the condition code, which is the last return code of the last |command.

Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Tue Apr 05, 2011 5:29 pm
Reply with quote

So, all you need to do is save the return code you want to see as THE return code and EXIT saved_return_code at the end.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
No new posts Adding QMF and SPUFI to the ISPF menu DB2 20
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
Search our Forums:

Back to Top