View previous topic :: View next topic |
Author |
Message |
krk123 Beginner

Joined: 03 Jun 2003 Posts: 58 Topics: 19
|
Posted: Mon Aug 04, 2003 11:02 am Post subject: Conditional execution of a step in a PROC. |
|
|
Hi All,
I would like to execute a particular step based on the value in the override parameter.
// IF (&CLIENT=XXXXX ) THEN
//STEP040 EXEC PGM=SORT...
Is it possible to acheive this thru an IF statement?
Regards,
Krk123. |
|
Back to top |
|
 |
ofer71 Intermediate
Joined: 12 Feb 2003 Posts: 358 Topics: 4 Location: Israel
|
Posted: Mon Aug 04, 2003 12:38 pm Post subject: |
|
|
Hi
As far as I know - you can't do this with IF statement.
If I had a mission like this, I would probably use REXX as intermediate step, ARGing the parameter, and EXIT with the corresponding RC.
O.
________
uhwh
Last edited by ofer71 on Sat Feb 05, 2011 11:00 am; edited 1 time in total |
|
Back to top |
|
 |
krk123 Beginner

Joined: 03 Jun 2003 Posts: 58 Topics: 19
|
Posted: Mon Aug 04, 2003 1:31 pm Post subject: |
|
|
Thanks ofer71.
If you have a sample REXX code can you please post it here. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Mon Aug 04, 2003 2:04 pm Post subject: |
|
|
Krk123,
Well there is a way of doing what you want, but the only catch is that compare field should be numeric.
For example , you have a proc called KRKPROC, where the client is defined as a symbolic. Now you want to execute the sort step only if the client number is 99.
Code: |
//KRKPROC PROC CLIENT=' '
//*
//STEP10 IF (99 EQ &CLIENT) THEN
//STEP40 EXEC PGM=SORT ...
// ELSE
//STEP50 EXEC PGM=ABEND
// ENDIF
// PEND
//GO EXEC KRKPROC,CLIENT='99'
//*
|
Hope this helps...
cheers
kolusu |
|
Back to top |
|
 |
krk123 Beginner

Joined: 03 Jun 2003 Posts: 58 Topics: 19
|
Posted: Mon Aug 04, 2003 3:08 pm Post subject: |
|
|
Hi Kolusu,
Thanks a lot for your response. unfortunately my field is an alphabetic. The field will be like 'ABCDEF' etc..
Regards,
krk123 |
|
Back to top |
|
 |
ofer71 Intermediate
Joined: 12 Feb 2003 Posts: 358 Topics: 4 Location: Israel
|
Posted: Mon Aug 04, 2003 8:34 pm Post subject: |
|
|
Hi
Here is a sample REXX:
Code: | /* REXX */
ARG PARM
SELECT
WHEN PARM = 'A' THEN EXITRC = 1
WHEN PARM = 'B' THEN EXITRC = 2
WHEN PARM = 'C' THEN EXITRC = 3
OTHERWISE EXITRC = 0
END
EXIT EXITRC |
O.
________
silver surfer reviews
Last edited by ofer71 on Sat Feb 05, 2011 11:01 am; edited 1 time in total |
|
Back to top |
|
 |
krk123 Beginner

Joined: 03 Jun 2003 Posts: 58 Topics: 19
|
Posted: Wed Aug 06, 2003 3:05 pm Post subject: |
|
|
Thanks Ofer |
|
Back to top |
|
 |
|
|