View previous topic :: View next topic
|
Author |
Message |
snehasai
New User
Joined: 14 Nov 2008 Posts: 23 Location: bangalore
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
Try using SELCOPY ..! |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Gousiya Mulla wrote: |
Try using SELCOPY ..! |
And if SELCOPY is unavailable at the site in question ? |
|
Back to top |
|
|
Gousiya Mulla
New User
Joined: 02 Jun 2008 Posts: 87 Location: Bangalore
|
|
|
|
Quote: |
And if SELCOPY is unavailable at the site in question ?
|
Sorry , not sure about the other options . |
|
Back to top |
|
|
snehasai
New User
Joined: 14 Nov 2008 Posts: 23 Location: bangalore
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
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 |
|
Back to top |
|
|
neelesht
New User
Joined: 24 Jul 2006 Posts: 99 Location: Los Angeles
|
|
|
|
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.
Thanks
Neelesh |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
dneufarth
Active User
Joined: 27 Apr 2005 Posts: 420 Location: Inside the SPEW (Southwest Ohio, USA)
|
|
|
|
Perhaps an in house pgm that invokes abend macro. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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. . . |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
aishwarya_20
New User
Joined: 19 Nov 2008 Posts: 57 Location: pune
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
let' s stop all this please!
1) how to find if a dataset is empty has been discussed too many times
and belongs to
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 |
|
|
|