View previous topic :: View next topic
|
Author |
Message |
kiran.v2
New User
Joined: 29 Jul 2005 Posts: 9
|
|
|
|
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 |
|
|
shivashunmugam Muthu
Active User
Joined: 22 Jul 2005 Posts: 114 Location: Chennai
|
|
|
|
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 |
|
|
kiran.v2
New User
Joined: 29 Jul 2005 Posts: 9
|
|
|
|
Hi Muthu,
Can u tell me how to pass values to RC.
Regards,
Murali. |
|
Back to top |
|
|
shivashunmugam Muthu
Active User
Joined: 22 Jul 2005 Posts: 114 Location: Chennai
|
|
|
|
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 |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
murali1508
New User
Joined: 28 Jul 2005 Posts: 5
|
|
|
|
Hi Priyesh,
Can u write that IF or COND Statement.
murali... |
|
Back to top |
|
|
priyesh.agrawal
Senior Member
Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
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 |
|
|
murali1508
New User
Joined: 28 Jul 2005 Posts: 5
|
|
|
|
Hi Priyesh,
I tried with u r Code it is Fine
Thank u Priyesh........
Murali. |
|
Back to top |
|
|
|