Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
trying to set return code in PROC

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
tanvi110788

New User


Joined: 19 May 2020
Posts: 5
Location: India

PostPosted: Wed May 20, 2020 2:02 pm    Post subject: trying to set return code in PROC
Reply with quote

Hi,

I have a proc with step that returns 28, i want to change the return code to 0. But the IDCAMS to set the return code is not working.
Can someone please help?

Here is the PROC -

Code:
//PRME0001 PROC

//CMPR001 EXEC PGM=ISRSUPC,
//            PARM=(DELTAL,FILECMP,
//            'FMSTOP',
//            '')
//NEWDD  DD DUMMY
//OLDDD  DD DUMMY
//OUTDD  DD DSN=&CMP1,
//          DISP=(NEW,PASS,DELETE),
//          UNIT=DISK,SPACE=(CYL,(10,10),RLSE)
//*
//MCIA001  EXEC PGM=MCIABEND,COND=(00,NE,CMPR001)
//*
//RCCHG01  EXEC PGM=IDCAMS,COND=(28,NE,CMPR001)
//SYSPRINT  DD SYSOUT=*
//SYSIN     DD *
 SET LASTCC = 0
/*
//**************************************


JCL:

Code:
//PRME0001 EXEC PRME0001
//*
//CMPR001.NEWDD DD DSN=xxx,DISP=SHR
//CMPR001.OLDDD DD DSN=xxx,DISP=SHR
//*


Coded for you - do it yourself next time
Back to top
View user's profile Send private message

enrico-sorichetti

Senior Member


Joined: 14 Mar 2007
Posts: 10701
Location: italy

PostPosted: Wed May 20, 2020 2:16 pm    Post subject: Reply to: trying to set return code in PROC
Reply with quote

Quote:
But the IDCAMS to set the return code is not working.


NOPE ...

IDCAMS set command works as designed

the SET CC and SET MAXCC deal only with the INTERNAL IDCAMS return codes ( the return codes of each IDCAMS command )
Back to top
View user's profile Send private message
tanvi110788

New User


Joined: 19 May 2020
Posts: 5
Location: India

PostPosted: Wed May 20, 2020 2:19 pm    Post subject:
Reply with quote

please suggest how to change the return code in this case ?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Wed May 20, 2020 2:31 pm    Post subject: Reply to: trying to set return code in PROC
Reply with quote

Fix the problem with the step that is causing it to return a code of 28.
Back to top
View user's profile Send private message
tanvi110788

New User


Joined: 19 May 2020
Posts: 5
Location: India

PostPosted: Wed May 20, 2020 2:35 pm    Post subject:
Reply with quote

Return code 28 is a valid one in my case. I can't fix the step that's returning 28. I just need to change the return code.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Wed May 20, 2020 2:48 pm    Post subject: Reply to: trying to set return code in PROC
Reply with quote

You cannot actually change the return code but...read up on the JOBRC parameter in the JCL Reference manual
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Wed May 20, 2020 3:07 pm    Post subject:
Reply with quote

Instead of using LASTCC in the IDCAMS step, use MAXCC there.
Back to top
View user's profile Send private message
tanvi110788

New User


Joined: 19 May 2020
Posts: 5
Location: India

PostPosted: Wed May 20, 2020 3:08 pm    Post subject:
Reply with quote

Joerg.Findeisen wrote:
Instead of using LASTCC in the IDCAMS step, use MAXCC there.


I used that MAXCC as well. It did not change the return code icon_sad.gif icon_sad.gif
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Wed May 20, 2020 3:19 pm    Post subject:
Reply with quote

Code:
 JOBCARD,JOBRC=(STEP,TEST)
//SETCC    EXEC PGM=IDCAMS                     
//SYSPRINT DD SYSOUT=*                         
//SYSIN    DD *                               
  SET MAXCC=5                                 
/*                                             
//TEST     EXEC PGM=IDCAMS,COND=(5,NE,SETCC)   
//SYSPRINT DD SYSOUT=*                         
//SYSIN    DD *                               
  SET MAXCC=0                                 
/*

Gives you the desired result
Code:
STEPNAME PROCSTEP CODE
SETCC             0005
TEST              0000
ENDED - RC=0000       
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Wed May 20, 2020 3:36 pm    Post subject: Reply to: trying to set return code in PROC
Reply with quote

Of course you could use IEFBR14 as a more economicl way of doing it. Whatever, you cannot alter the return code set by SuperC but have to execute another program to which the JOBRC can refer when setting the completion code for the whole job.

So...
Code:

//NICC01 JOB JOBRC=(STEP,DUMMY)...
:
//COMPARE EXEC PGM=ISRSUPC
:
//DUMMY EXEC PGM=IEFBR14
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 860
Location: Maryland

PostPosted: Wed May 20, 2020 4:58 pm    Post subject: Re: trying to set return code in PROC
Reply with quote

tanvi110788 wrote:
Hi,

I have a proc with step that returns 28, i want to change the return code to 0. But the IDCAMS to set the return code is not working.
Can someone please help?


1) Rule number 1: Not everything which is not COBOL is JCL!

2) IDCAMS is (one of tons of) utility programs. It has nothing to do with JCL itself

3) The RC from one of JCL step cannot affect RC from another JCL step. (But you can choose which one to use as JOB COMPLETION CODE, as demonstrated by Nic)

4) Why the RC from SUPERC step does bother you? It only shows the result of this particular step, nothing else is affected...

5) The whole topic is one more demonstration of absolute misunderstanding by 90% of new "computer experts", - what JCL is? icon_pray.gif
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 860
Location: Maryland

PostPosted: Wed May 20, 2020 5:11 pm    Post subject:
Reply with quote

Joerg.Findeisen wrote:
Instead of using LASTCC in the IDCAMS step, use MAXCC there.

Both LASTCC, and MAXCC are the control statements of IDCAMS utility itself. They can change only the return code for that particular JCL step where IDCAMS is invoked.

Neither LASTCC, no MAXCC is in no way a JCL control statement; so none of them is able to change any other completion code except its own step.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1091
Location: Dublin, Ireland

PostPosted: Wed May 20, 2020 7:19 pm    Post subject:
Reply with quote

Quote:
Return code 28 is a valid one in my case. I can't fix the step that's returning 28. I just need to change the return code.


I think the real question is WHY would you want to change the step's cond code? And why can't you use IF THEN /ELSE checks to achieve the desired result?

Garry
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Wed May 20, 2020 7:31 pm    Post subject:
Reply with quote

@sergeyken: I have have not claimed anything else. Usually I agree with your point of view.

ISRSUPC - 'EMPTYOK', * if comparing empty Datasets RC0 not RC28
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1091
Location: Dublin, Ireland

PostPosted: Wed May 20, 2020 8:10 pm    Post subject:
Reply with quote

Code:
//CMPR001 EXEC PGM=ISRSUPC,
//            PARM=(DELTAL,FILECMP,
//            'FMSTOP',
//            '')
//NEWDD  DD DUMMY
//OLDDD  DD DUMMY
//OUTDD  DD DSN=&CMP1,
//          DISP=(NEW,PASS,DELETE),
//          UNIT=DISK,SPACE=(CYL,(10,10),RLSE)
//*


It seems pretty pointless trying to compare two DD DUMMY datasets? I expect that these would normally be subject to overrides?

Documentation says:
28 ERROR. No data was compared because of invalid file names, no commonly named members of both input file groups, or one or both input files were empty.

I expect DD DUMMY is considered invalid.

Garry.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active User


Joined: 15 Aug 2015
Posts: 342
Location: Bamberg, Germany

PostPosted: Thu May 21, 2020 7:25 am    Post subject:
Reply with quote

@Gary: Make something Idiot proof, and someone will invent a better Idiot. It is legit to compare two DUMMY datasets. IMHO the TS just has to add EMPTYOK parm and that's it.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Easytrieve EZABX007 with error code 0... Carol Schablow CA Products 7 Thu Sep 24, 2020 3:30 am
This topic is locked: you cannot edit posts or make replies. VSAM I/O - Extended Addressability - ... amitsjcntl JCL & VSAM 12 Mon Jul 06, 2020 3:51 pm
No new posts Force a Return Code and print error m... Rick Ryan SYNCSORT 30 Thu Jun 25, 2020 1:18 am
No new posts Need help in REXX code to list the af... chavinash2004 CLIST & REXX 3 Wed Apr 01, 2020 12:53 pm
No new posts Error Creating KSDS file, REASON CODE... sandeep prajapati JCL & VSAM 8 Tue Mar 24, 2020 12:05 pm

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us