Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
kishpra

New User


Joined: 24 May 2010
Posts: 86
Location: Pune

PostPosted: Mon Mar 14, 2011 3:10 pm    Post subject: How to set return code in the JCL which has ISPF commands
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: 8593
Location: Back in jolly old England

PostPosted: Mon Mar 14, 2011 4:49 pm    Post subject:
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: 2360
Location: Israel

PostPosted: Mon Mar 14, 2011 5:59 pm    Post subject:
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: 1715
Location: UK

PostPosted: Mon Mar 14, 2011 6:23 pm    Post subject:
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: 86
Location: Pune

PostPosted: Tue Mar 15, 2011 11:28 am    Post subject: Reply to: How to set return code in the JCL which has ISPF c
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: 86
Location: Pune

PostPosted: Tue Mar 15, 2011 11:53 am    Post subject: Reply to: How to set return code in the JCL which has ISPF c
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: 1715
Location: UK

PostPosted: Tue Mar 15, 2011 11:54 am    Post subject:
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    Post subject:
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.

http://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: 1738
Location: Bloomington, IL

PostPosted: Tue Apr 05, 2011 2:32 am    Post subject:
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.

http://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: 258

PostPosted: Tue Apr 05, 2011 1:28 pm    Post subject:
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: 1715
Location: UK

PostPosted: Tue Apr 05, 2011 5:29 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am
No new posts What is the code in CLIST to enable t... jackzhang75 CLIST & REXX 1 Fri Dec 02, 2016 3:02 am
No new posts IDEAL - Code Retrieval yugendran CA Products 0 Fri Nov 25, 2016 3:27 pm
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts DFHWS2LS return value divated CICS 4 Mon Nov 07, 2016 5:44 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us