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
 

 

Check if file is empty and pass returncode=20

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Mon Apr 27, 2009 2:21 pm    Post subject: Check if file is empty and pass returncode=20
Reply with quote

Hi,
can anyone help me out in writing JCL for checking the input file is empty or not.

If file is empty then returncode should be 20 so that my next processing steps should be stopped and Rc=20 is making my job abend.

I have tried using RC=04 for following jcl which worked if input file is empty but i need RC=20 instead of RC=4

//STEP001 EXEC PGM=SORT,PARM='NULLOUT=RC4'
//SORTIN DD DSN=inputfile,
//* DISP=SHR
//SORTOUT DD DUMMY
//SYSIN DD *
SORT FIELDS=COPY
//*
//SYSOUT DD SYSOUT=*
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 27, 2009 2:23 pm    Post subject:
Reply with quote

Oh well, I think you may find that either SORT or IDCAMS will only set a RC up to a value of 16
Back to top
View user's profile Send private message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 87
Location: Bangalore

PostPosted: Mon Apr 27, 2009 2:48 pm    Post subject: Check if file is empty and pass returncode=20
Reply with quote

Try using SELCOPY ..!
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Apr 27, 2009 2:50 pm    Post subject: Re: Check if file is empty and pass returncode=20
Reply with quote

Gousiya Mulla wrote:
Try using SELCOPY ..!

And if SELCOPY is unavailable at the site in question ?
Back to top
View user's profile Send private message
Gousiya Mulla

New User


Joined: 02 Jun 2008
Posts: 87
Location: Bangalore

PostPosted: Mon Apr 27, 2009 2:55 pm    Post subject: Check if file is empty and pass returncode=20
Reply with quote

Quote:
And if SELCOPY is unavailable at the site in question ?


Sorry , not sure about the other options .
Back to top
View user's profile Send private message
snehasai

New User


Joined: 14 Nov 2008
Posts: 23
Location: bangalore

PostPosted: Mon Apr 27, 2009 2:56 pm    Post subject:
Reply with quote

I have no option other than using SORT.

Or another option may be 1st step wud be checking the file empty or not
step1:IF empty RC=4 else RC=0 it will provide
step2: The next processing steps should have Rc=20 if 1st step RC=4 so that it hits abend in our system

How to to this what is the condition to be specified for further steps so depending on File to process the follwing steps or not.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Mon Apr 27, 2009 3:00 pm    Post subject: Reply to: Check if file is empty and pass returncode=20
Reply with quote

Just curious - waiting for my coffee to cool down a bit
there is some psychics behind testing for 20 and not wanting to test for 4
- sigmund might go crazy with some people way of thinking icon_biggrin.gif
Back to top
View user's profile Send private message
neelesht

New User


Joined: 24 Jul 2006
Posts: 99
Location: Los Angeles

PostPosted: Tue Apr 28, 2009 3:59 am    Post subject:
Reply with quote

Enrico,

If I am not wrong, Sowjanya wants to assign RC=20 and not RC=04 because in one of the later steps she wants to abend the JCL if file was empty and she can not abend it with RC=04 since any step can have RC=04 but none can have RC=20.

Hope I am not confusing. icon_smile.gif

Thanks
Neelesh
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Apr 28, 2009 4:27 am    Post subject:
Reply with quote

Neelesh,

how can she 'ABEND' the JCL?

in the later step she can very simply COND on the step
(the one she wants a RC-20)
for 04 and not execute the step. Or use an IF/THEN/ELSE.
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 236
Location: Cincinnati OH USA

PostPosted: Tue Apr 28, 2009 4:45 am    Post subject:
Reply with quote

Perhaps an in house pgm that invokes abend macro.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Apr 28, 2009 5:48 am    Post subject:
Reply with quote

Hello,

If the utilities that can set an rc for an "empty" file cannot be used as written/documented, one can always write their "own code" to generate any valid rc. . .

If it rather nonsense to not use a particular rc because it is "not the one we want" - especially when that particular step issuing an "04" is different from any other step and might be tested individually.

I expect Neelesh has understood exactly why the request is made and all it shows is there is a certain amount of laziness (or lack of understanding about how jcl can use the rc) about. . .

Suggest the rc be used as implemented or a bit of code be written to do exactly what is wanted. . . icon_neutral.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Tue Apr 28, 2009 6:37 am    Post subject:
Reply with quote

neelesht wrote:
Sowjanya wants to assign RC=20 and not RC=04 because in one of the later steps she wants to abend the JCL if file was empty and she can not abend it with RC=04 since any step can have RC=04 but none can have RC=20.
Sowjanya may want what he/she wants, but without writing some code his/her limits are limited to 0, 4 & 16....
Look at NULLOUT and NULLOFL
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Apr 28, 2009 11:18 am    Post subject:
Reply with quote

Quote:
since any step can have RC=04 but none can have RC=20

How do you know this. I have seen plenty of programs issue return codes 20 and above.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Apr 28, 2009 2:15 pm    Post subject:
Reply with quote

Quote:
how can she 'ABEND' the JCL?


Quote:
Perhaps an in house pgm that invokes abend macro.


sorry, was being a stickler for definitions.

it would be the JOB that abends,
JCL does not abend,
JCL is either accepted by JES or not.
Back to top
View user's profile Send private message
aishwarya_20

New User


Joined: 19 Nov 2008
Posts: 57
Location: pune

PostPosted: Tue Apr 28, 2009 2:22 pm    Post subject: Reply to: Check if file is empty and pass returncode=20
Reply with quote

This topic has already been discussed. Please check below link.

http://ibmmainframes.com/viewtopic.php?t=11350


You can use IDCAMS
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Tue Apr 28, 2009 2:30 pm    Post subject: Reply to: Check if file is empty and pass returncode=20
Reply with quote

let' s stop all this please!

1) how to find if a dataset is empty has been discussed too many times
and belongs to
http://www.ibmmainframes.com/viewtopic.php?t=20820

2) how to set a return code to 20...
no utility will let You do it,
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    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
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm


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