Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

RESET condition code in JCl

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: RESET condition code in JCl
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: 1452
Location: Chicago, IL

PostPosted: Thu Nov 16, 2006 10:43 pm    Post subject: Re: RESET condition code in JCl
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    Post subject: Re: RESET condition code in JCl
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    Post subject: Re: RESET condition code in JCl
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: 6967
Location: porcelain throne

PostPosted: Fri Nov 17, 2006 1:07 am    Post subject: Re: RESET condition code in JCl
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    Post subject: Re: RESET condition code in JCl
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    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Fri Nov 17, 2006 4:42 am    Post subject: Re: RESET condition code in JCl
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    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Fri Nov 17, 2006 10:17 am    Post subject: Re: RESET condition code in JCl
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    Post subject: Re: RESET condition code in JCl
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: 1452
Location: Chicago, IL

PostPosted: Sun Nov 19, 2006 10:22 am    Post subject: Re: RESET condition code in JCl
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    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
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us