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

Reset Return Code for PROGPROC


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

Senior Member


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

PostPosted: Wed Jun 22, 2005 7:40 pm
Reply with quote

Hi All,

I've 3 steps in my JCL.

STEP1- check file EMPTY or NOT.
STEP2- process only if file not EMPTY.
STEP3- PROGPROC.

Now the prob is if file is Empty, STEP2 will get skipped, but Return Code by STEP1 (which will be greater than zero) will cause STEP3 (PROGPROC) to abend.

Now what can be the way by which I can run STEP2 based on STEP1 and have a MAXCC=0 in STEP3.

Regards,

Priyesh.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Wed Jun 22, 2005 8:40 pm
Reply with quote

Why you must have 0 as Return code? You cannot work with a 1?
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Wed Jun 22, 2005 8:41 pm
Reply with quote

Sorry... It's impossible reset the rc of a job... you can only reset the rc(last and max) of internal function of IDCAMS if you are referring to it as sample.
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 Jun 23, 2005 7:10 pm
Reply with quote

Hi MGIndaco,

Quote:
Why you must have 0 as Return code? You cannot work with a 1?


I need to have an RC=0 before coming to STEP3, as its a PROGPROC step which dont allow any thing greater from earlier steps.

My requirement is to simply run STEP2 if a given file is not EMPTY. and then some where later I have a PROGPROC step to be executed.

Now If by any means I m checking for Empty FIle, Its giving a higher RC incase Empty FIle, which consequently creating problem for PROGPROC.

Is there any way, I can get maxcc=0, If file is empty & maxcc=other if not empty.

Or any other solution to this prob from ur perspective.

Regards,

Priyesh.
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Thu Jun 23, 2005 7:33 pm
Reply with quote

Hi Priyesh!

Why dont you code the COND parameter even for the step3 which checks the step1's RC. Will that not help you!
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu Jun 23, 2005 7:46 pm
Reply with quote

I think that you must change one of the two contition in your jcl.
You can play the Rc of empty test as you want but once a time.
I suppose that if you can't change the jcl you will modify the pgm of second step and play with its file status...
Back to top
View user's profile Send private message
subhasis_50

Moderator


Joined: 09 Mar 2005
Posts: 363
Location: Earth

PostPosted: Fri Jun 24, 2005 11:12 am
Reply with quote

Hi,
Quote:
I need to have an RC=0 before coming to STEP3, as its a PROGPROC step which dont allow any thing greater from earlier steps.


You need return code 0 in step3 and you have to run step2 only if the file in step1 is not empty. In case of empty file the step2 is bypassed as u give cond code there. So in that case if u want to run step3 just code a dummy step between step3 and step2. And dont give any cond parameter there. So step3 will not abend though step 2 is bypassed.

Step2....
//*then code the dummy step
//STEPD EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DUMMY
//SYSUT2 DD DUMMY
//step3

Hope it helps.
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 Jun 24, 2005 5:38 pm
Reply with quote

Hi All,

Firstly Thanks all of you to put effort.

Quote:
Hi Priyesh!

Why dont you code the COND parameter even for the step3 which checks the step1's RC. Will that not help you!


Anu, This won't work......As, befor echecking COND Parm, PROGPROC checks for the RCs by earlier steps.

Quote:
Step2....
//*then code the dummy step
//STEPD EXEC PGM=IEFBR14
//SYSPRINT DD SYSOUT=*
//SYSUT1 DD DUMMY
//SYSUT2 DD DUMMY
//step3

Hope it helps.


Subhasis_30, I tried this code too, But it is also not working.

Quote:
I suppose that if you can't change the jcl you will modify the pgm of second step and play with its file status...


MGIndaco, This seemes to be the last option. Earlier I was not keen to play with program inside STEP2....Now It doesn't look like any other option.

Once again Thank you all.

Regards,

Priyesh.
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Fri Jun 24, 2005 7:06 pm
Reply with quote

Hi Priyesh!

Can you provide us the JCL. May be after seeing that we can give you the solution. But I still wonder why COND will not solve your purpose. Anyways just give the JCL.
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 Jun 24, 2005 7:22 pm
Reply with quote

Hi Anuradha,

Quote:
Can you provide us the JCL


Code:
//STEP1     EXEC PGM=IDCAMS                 
//IN DD DSN=RECORDS.INPUT,DISP=SHR
//SYSPRINT DD SYSOUT=*                     
//SYSIN DD DATA                           
PRINT INFILE(IN) COUNT(1)                 
/*         
//STEP2          U Can assume any thing, as its going to be skipped.
//*
//STEP3     EXEC PROGPROC,                                     
//             GP=TMSDD,                                       
//             PGMNAME=PROGRAMNAME
//PRGIN   DD DSN=PRG.INPUT,
//            DISP=SHR                                         
//RPT01    DD DSN=PRG.OUT,
//            DISP=(,CATLG,DELETE),                           
//            SPACE=(6118,(0100,033),RLSE),UNIT=SYSDA         
//STATISTR DD SYSOUT=*                                         
//**     



So now, STEP1 will return RC > 0, in case of empty file. & It causes prob in STEP3.

Quote:
But I still wonder why COND will not solve your purpose.

I tried with that, but it was not doing.

Regards,

Priyesh.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Jun 24, 2005 8:08 pm
Reply with quote

Hi Priyesh, another question: the empty file is used in both the pgm?
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 Jun 24, 2005 8:10 pm
Reply with quote

Hi MGIndaco,

STEP2 is using that file... Thats why I have to skip STEP2 if file found EMPTY......STEP3 is not using that file.

Regards,

Priyesh.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Jun 24, 2005 8:11 pm
Reply with quote

Which are the COND parameter that you use?
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 Jun 24, 2005 8:18 pm
Reply with quote

I had given an IF Condition before STEP2 checking for RC of STEP1.

Code:
//IFSTEP2#  IF (STEP1.RC=0)
//*
//STEP2
//*
//ENDSTEP2#  ENDIF


Regards,
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Jun 24, 2005 8:25 pm
Reply with quote

And in the followed PROC which are the condition?
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Fri Jun 24, 2005 8:28 pm
Reply with quote

Hi Priyesh!

I really wonder why COND parameters are not working. Okey let me give them..

Code:
//PS001  EXEC PGM=IDCAMS                       
//IN   DD DSN=Userid.TEST.IN,DISP=SHR         
//SYSPRINT DD SYSOUT=*                         
//SYSIN    DD DATA                             
   PRINT INFILE(IN) COUNT(1)                   
/*                                             
//PS002  EXEC PGM=IEFBR14,COND=(0,LT,PS001)     
...
...
//PS003    EXEC PGM=IKJEFT01,COND=(8,LT,PS001)


Just try with the above code.

In the above code if 'Userid.TEST.IN is empty it is going to give RC=4. As 0 is less than 4, step2 will be skipped.. As 8 is not less than 4 step3 will be executed.

Let us know the results..
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 Jun 24, 2005 8:28 pm
Reply with quote

Nothing cond specified for PROC....But as it is a PROGPROC stmt...It will check for all the RCs from earlier steps....& on an empty file STEP1 wont return a zero. which will cause an abend to PROGPROC.

ok, man....Now its time to leave....will c u on Monday....

Regards,

Priyesh.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Fri Jun 24, 2005 8:34 pm
Reply with quote

I don't think... I don't know what your PROGPROC do but if you use the typrun=scan and see the explosion of the proc you will see if it has a condition parameter. If no condition is specify, but it is you can work with a rc = 1 and go to the end of job.(you can also override the cond in the proc... I think that most rc used begin from 4...)
Good we.
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


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

PostPosted: Mon Jun 27, 2005 1:09 pm
Reply with quote

Hey anuradha,....That worked......STEP3 was executing then....

Thanks a lot for you & MGIndaco for helping me......

The last doubt I have, is when I coded IDCAMS for checking Empty File(It is posted in one of my earlier reply), It was returning an RC=12. But the Same code from You returned 4.

the only difference I could mark in duo is

Code:
   PRINT INFILE(IN) COUNT(1)         urs code

PRINT INFILE(IN) COUNT(1)            mine

Is this the cause behind RC=12....& that was leading to a problem in further STEP3.

Thanks again for the effort.

Regards,

Priyesh.
Back to top
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Mon Jun 27, 2005 1:41 pm
Reply with quote

In IDCAMS utility(and I think for the other utility too) all the command start in position 2 icon_biggrin.gif
It's a common error but not to bad...
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 run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top