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

trying to set return code in PROC


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10886
Location: italy

PostPosted: Wed May 20, 2020 2:16 pm
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
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: 2454
Location: Hampshire, UK

PostPosted: Wed May 20, 2020 2:31 pm
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
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: 2454
Location: Hampshire, UK

PostPosted: Wed May 20, 2020 2:48 pm
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

Senior Member


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

PostPosted: Wed May 20, 2020 3:07 pm
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
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

Senior Member


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

PostPosted: Wed May 20, 2020 3:19 pm
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: 2454
Location: Hampshire, UK

PostPosted: Wed May 20, 2020 3:36 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2136
Location: USA

PostPosted: Wed May 20, 2020 4:58 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2136
Location: USA

PostPosted: Wed May 20, 2020 5:11 pm
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: 1205
Location: Dublin, Ireland

PostPosted: Wed May 20, 2020 7:19 pm
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

Senior Member


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

PostPosted: Wed May 20, 2020 7:31 pm
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: 1205
Location: Dublin, Ireland

PostPosted: Wed May 20, 2020 8:10 pm
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

Senior Member


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

PostPosted: Thu May 21, 2020 7:25 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Starting a PROC with parameters from ... CLIST & REXX 6
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 Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top