View previous topic :: View next topic
|
Author |
Message |
swapnadeep.ganguly
Active User
Joined: 21 Mar 2007 Posts: 203 Location: India
|
|
|
|
Hi,
I am required to display a dataset (DA) in the spool region if the return code is equal to 50 else i am to display another dataset (DB) if return from a previous step is non zero.
I have thought of the following code.
Can any one please let me know whether I am correct in my approach or not:
Code: |
//ABIF1 IF STEP02.RC>0 THEN
//CALLLIST EXEC PGM=COPYHASP
//*
//SYSIN DD DSN=PV5240A.ONCALL.DATA,DISP=SHR
//SYSOUT DD SYSOUT=*
//*
//ABIF2 IF STEP02.RC=50 THEN
//SYSIN DD DSN=PV5240A.PROGRAM.ERROR,DISP=SHR
//SYSOUT DD SYSOUT=*
// ELSE
//SYSIN DD DSN=PV5240A.SERVICE.ERROR,DISP=SHR
//SYSOUT DD SYSOUT=*
// ENDIF
|
Thank you in advance for your response. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
You can not code only DD statements in IF ELSE. You need to code EXEC statements for that. Also your requirement is not clear to us, because rc > 0 will get satisfied when rc = 50, how do you want to deal with such situation?
Please clarify. |
|
Back to top |
|
|
swapnadeep.ganguly
Active User
Joined: 21 Mar 2007 Posts: 203 Location: India
|
|
|
|
In the COBOL program I would be returning two different return code values to the variable.
According to this return code, I want to print the error file in the spool. |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
You need to do something like -
Code: |
//ABIF1 IF STEP02.RC>0 THEN
//CALLLIS1 EXEC PGM=COPYHASP
//*
//SYSIN DD DSN=PV5240A.ONCALL.DATA,DISP=SHR
//SYSOUT DD SYSOUT=*
//*
// ENDIF
//ABIF2 IF STEP02.RC=50 THEN
//CALLLIS2 EXEC PGM=COPYHASP
//SYSIN DD DSN=PV5240A.PROGRAM.ERROR,DISP=SHR
//SYSOUT DD SYSOUT=*
// ELSE
//CALLLIS3 EXEC PGM=COPYHASP
//SYSIN DD DSN=PV5240A.SERVICE.ERROR,DISP=SHR
//SYSOUT DD SYSOUT=*
// ENDIF
|
You still have not answered my question -
Also your requirement is not clear to us, because rc > 0 will get satisfied when rc = 50, how do you want to deal with such situation?
Please clarify, so that we can help you to get the solution. |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Swanadeep,
chnage the rc>0 condition to (rc>0 and rc ne 50) |
|
Back to top |
|
|
swapnadeep.ganguly
Active User
Joined: 21 Mar 2007 Posts: 203 Location: India
|
|
|
|
Abhijit,
swapnadeep.ganguly wrote: |
In the COBOL program I would be returning two different return code values to the variable.
According to this return code, I want to print the error file in the spool.
One of the variable would contain a value of 50 and other any non zero value.
For the return code = 50, I would call the dataset DA and for the other case, the other dataset (DB)
|
|
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Swapnadeep,
Quote: |
CALLLIS1 EXEC PGM=COPYHASP |
Is this the cobol program? |
|
Back to top |
|
|
swapnadeep.ganguly
Active User
Joined: 21 Mar 2007 Posts: 203 Location: India
|
|
|
|
no
the cobol program is called in STEP02..
i am checking the return code from STEP02 |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Did you get solution to your problem yet? I hope you have considered Murali's point about 'condition check'.. |
|
Back to top |
|
|
swapnadeep.ganguly
Active User
Joined: 21 Mar 2007 Posts: 203 Location: India
|
|
|
|
Yes.
I got the solution to my problem.
Thanks to all of you who helped me to get the solution to my problem. |
|
Back to top |
|
|
|