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

RESET condition code in JCl


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sood16

New User


Joined: 23 Jul 2006
Posts: 5

PostPosted: Thu Nov 16, 2006 10:25 pm
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Thu Nov 16, 2006 10:43 pm
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Nov 16, 2006 10:46 pm
Reply with quote

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
View user's profile Send private message
sood16

New User


Joined: 23 Jul 2006
Posts: 5

PostPosted: Fri Nov 17, 2006 12:49 am
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Nov 17, 2006 1:07 am
Reply with quote

you say misleading. Why wouldn't you want to know that the dataset is empty?
Back to top
View user's profile Send private message
sood16

New User


Joined: 23 Jul 2006
Posts: 5

PostPosted: Fri Nov 17, 2006 3:53 am
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Fri Nov 17, 2006 4:23 am
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Fri Nov 17, 2006 4:42 am
Reply with quote

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
View user's profile Send private message
chandu321
Currently Banned

New User


Joined: 27 Jun 2006
Posts: 8

PostPosted: Fri Nov 17, 2006 9:58 am
Reply with quote

I guess following should work

IF RC > 8 Set RC = 0
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Fri Nov 17, 2006 10:17 am
Reply with quote

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
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Sun Nov 19, 2006 7:11 am
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Sun Nov 19, 2006 10:22 am
Reply with quote

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... icon_biggrin.gif

Regards,
Priyesh.
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 Help required to reset decimal points... DFSORT/ICETOOL 8
No new posts Add condition to a FINDREP SORT card DFSORT/ICETOOL 4
No new posts To Omit records based n SORT condition DFSORT/ICETOOL 6
No new posts Using Multiple IFTHEN and WHEN condit... SYNCSORT 12
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top