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

[Solved]Execution of particular steps based on Condition


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

New User


Joined: 29 Jul 2005
Posts: 9

PostPosted: Thu Aug 04, 2005 10:29 am
Reply with quote

Hi All,

In my JCL i have 10 Steps, in 3rd Step i am writing into the file,

If that file is empty i want to Execute 4th step other wise i want to execute 6th step.


Pls give me the code...



Regards,
Murali.
Back to top
View user's profile Send private message
shivashunmugam Muthu

Active User


Joined: 22 Jul 2005
Posts: 114
Location: Chennai

PostPosted: Thu Aug 04, 2005 11:34 am
Reply with quote

Hi Murali,

1. Use COND code

2. Explicit IF condtion

Both will do ur reqmnt

Like...for first one

In step3, if nothing is written in outfile, pass value to RC (Return-code). Based on the RC, execute step4 else skip 4&5
Back to top
View user's profile Send private message
kiran.v2

New User


Joined: 29 Jul 2005
Posts: 9

PostPosted: Thu Aug 04, 2005 12:18 pm
Reply with quote

Hi Muthu,

Can u tell me how to pass values to RC.


Regards,
Murali.
Back to top
View user's profile Send private message
shivashunmugam Muthu

Active User


Joined: 22 Jul 2005
Posts: 114
Location: Chennai

PostPosted: Thu Aug 04, 2005 1:45 pm
Reply with quote

You can pass the value as

MOVE XXXX TO RETURN-CODE

RC - 4 byte cobol system variable. this statement can be coded with any conditional statement
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 Aug 04, 2005 4:10 pm
Reply with quote

Hi Murali,
Quote:
In my JCL i have 10 Steps, in 3rd Step i am writing into the file,

If that file is empty i want to Execute 4th step other wise i want to execute 6th step.

If you are willing for a JCL way....Code an IDCAMS step after 3rd step which checks for empty file....& returns 4 in case of empty....

Then by IF conditions or COND parm you can execute steps as per ur requirements......

Regards,

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

New User


Joined: 28 Jul 2005
Posts: 5

PostPosted: Fri Aug 05, 2005 12:32 pm
Reply with quote

Hi Priyesh,

Can u write that IF or COND Statement.


murali...
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 Aug 05, 2005 1:05 pm
Reply with quote

Code:
//STEP3
FILE IS BEING WRITTEN
//
//STEP0  EXEC PGM=IDCAMS                             
//IN   DD DSN=FILE TO BE CHEKCED,DISP=SHR   
//SYSPRINT DD SYSOUT=*                               
//SYSIN    DD DATA                                   
   PRINT INFILE(IN) COUNT(1)                         
/*                                                   
//IFSTEP4#  IF (STEP0.RC=4) THEN 
//STEP4,
//STEP5
//ENDSTEP4# ENDIF
//STEP6
//


Here I have assumed you want to skip STEP4 & STEP5 in case the file having records....as u said
Quote:
If that file is empty i want to Execute 4th step other wise i want to execute 6th step.


If any doubt...get me back...

Regards,

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

New User


Joined: 28 Jul 2005
Posts: 5

PostPosted: Fri Aug 05, 2005 2:09 pm
Reply with quote

Hi Priyesh,

I tried with u r Code it is Fine

Thank u Priyesh........


Murali.
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 Capturing Job Execution Information All Other Mainframe Topics 3
No new posts CA7 deleting files in steps after job... CA Products 4
No new posts To search DB2 table based on Conditio... DB2 1
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
No new posts Split large FB file based on Key coun... DFSORT/ICETOOL 4
Search our Forums:

Back to Top