MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Conditional execution of a step in a PROC.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
krk123
Beginner


Joined: 03 Jun 2003
Posts: 58
Topics: 19

PostPosted: Mon Aug 04, 2003 11:02 am    Post subject: Conditional execution of a step in a PROC. Reply with quote

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
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Mon Aug 04, 2003 12:38 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
krk123
Beginner


Joined: 03 Jun 2003
Posts: 58
Topics: 19

PostPosted: Mon Aug 04, 2003 1:31 pm    Post subject: Reply with quote

Thanks ofer71.
If you have a sample REXX code can you please post it here.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Mon Aug 04, 2003 2:04 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
krk123
Beginner


Joined: 03 Jun 2003
Posts: 58
Topics: 19

PostPosted: Mon Aug 04, 2003 3:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Mon Aug 04, 2003 8:34 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
krk123
Beginner


Joined: 03 Jun 2003
Posts: 58
Topics: 19

PostPosted: Wed Aug 06, 2003 3:05 pm    Post subject: Reply with quote

Thanks Ofer
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL) All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group