View previous topic :: View next topic
|
Author |
Message |
tanvi110788
New User
Joined: 19 May 2020 Posts: 5 Location: India
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
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 |
|
|
tanvi110788
New User
Joined: 19 May 2020 Posts: 5 Location: India
|
|
|
|
please suggest how to change the return code in this case ? |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
Fix the problem with the step that is causing it to return a code of 28. |
|
Back to top |
|
|
tanvi110788
New User
Joined: 19 May 2020 Posts: 5 Location: India
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
You cannot actually change the return code but...read up on the JOBRC parameter in the JCL Reference manual |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Instead of using LASTCC in the IDCAMS step, use MAXCC there. |
|
Back to top |
|
|
tanvi110788
New User
Joined: 19 May 2020 Posts: 5 Location: India
|
|
|
|
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 |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2136 Location: USA
|
|
|
|
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? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2136 Location: USA
|
|
|
|
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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
@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 |
|
|
Garry Carroll
Senior Member
Joined: 08 May 2006 Posts: 1205 Location: Dublin, Ireland
|
|
|
|
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 |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
@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 |
|
|
|