View previous topic :: View next topic
|
Author |
Message |
sood16
New User
Joined: 23 Jul 2006 Posts: 5
|
|
|
|
Hi
Is there any way I can reset the condition code in JCL?
I am reading a dataset and if its empty JCL returns 4. I want to reset it to 0 in JCL and proceed to further steps..Pl advice
Thanks |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
Is there any way I can reset the condition code in JCL? |
Not really. You can reset MAXCC internally in step such as in case of IDCAMS.
Quote: |
I am reading a dataset and if its empty JCL returns 4. |
What is this step... executing any program or ???
Quote: |
I want to reset it to 0 in JCL and proceed to further steps..Pl advice |
This can be done using COND parameter for further steps to include RC=4 alongwith RC=0 from previous step.
You may probably describe the dependency first between steps. |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
sood16,
Why reset the condition code? This should not impede execution of the remaining steps unless you want it to by the use of COND= on the remaining steps.
Let us know why you think the condition code should be reset.
Dave |
|
Back to top |
|
|
sood16
New User
Joined: 23 Jul 2006 Posts: 5
|
|
|
|
This step is the last step and job gives return code 4 so its misleading..
this step is using IEBGENER and sending the report to some system |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you say misleading. Why wouldn't you want to know that the dataset is empty? |
|
Back to top |
|
|
sood16
New User
Joined: 23 Jul 2006 Posts: 5
|
|
|
|
As the requirement is - empty report should not be sent
Is there any way to reset the Condition Code..report is not sent but it returns CC 04 |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
sood16,
Try this:
Code: |
//JS00100 EXEC PGM=IDCAMS
//DDIN DD DSN=your.report.file,
// DISP=SHR
//SYSPRINT DD DUMMY
//SYSIN DD *
PRINT IFILE(DDIN) COUNT(1)
//JS00200 EXEC PGM=IEBGENER,COND=(4,EQ,JS00100)
:
:
|
Add this IDCAMS step just before the IEBGENER step.
The IDCAMS step will return CC=0004 if the file is empty, the COND=(4,EQ,JS00100) will skip the IEBGENER step if JS00100 CC=0004
Dave |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
The IDCAMS step will return CC=0004 if the file is empty, the COND=(4,EQ,JS00100) will skip the IEBGENER step if JS00100 CC=0004 |
This'll not help in this scenario as IDCAMS would again cause Job to generate RC=04, and that is MISLEADING as per original poster for them to understand the job went fine.
So coding IDCAMS is same as IEBGENER, as both are generating RC=04 in case file is empty. |
|
Back to top |
|
|
chandu321 Currently Banned New User
Joined: 27 Jun 2006 Posts: 8
|
|
|
|
I guess following should work
IF RC > 8 Set RC = 0 |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Quote: |
I guess following should work
IF RC > 8 Set RC = 0 |
Chandu... Would you pls explain... How do you guess so ? |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
priyesh.agrawal
sood16 wrote: |
As the requirement is - empty report should not be sent
Is there any way to reset the Condition Code..report is not sent but it returns CC 04
|
I understand that the IDCAMS step would also generate a RC=0004, but the IDCAMS step would prevent the empty report from being sent.
Personally, I would like the CC=0004 if the report was empty, a quick reference to tell if no report was sent.
I wonder if IDCAMS could be used to copy the reports to various outputs and then set MAXCC=0
Dave |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Hello Dave,
Quote: |
Is there any way to reset the Condition Code..report is not sent but it returns CC 04 |
I interpreted this line from original poster as, the report is not being sent in case of empty but the problem is CC=04; which is misleading to them.
Thats what caused me to say that putting IDCAMS is the same. No contradiction on your suggestions...
Regards,
Priyesh. |
|
Back to top |
|
|
|