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

Joined: 14 May 2006 Posts: 40 Topics: 18
|
Posted: Wed Apr 18, 2007 9:51 am Post subject: Based on Input needs to execute steps availbe in JCL |
|
|
Hi,
There are 3 programs: 1, 2 and 3.
Step 1 executes program 1.
Step 2 executes programs 2 & 3.
There is a variable called as _________________ Thanks&Regards
Prasanth Thavva |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Apr 18, 2007 9:58 am Post subject: |
|
|
Quote: |
If Option = A, Step I should get executed, else Step 2 should get executed. How do I code this in a JCL using an If-then-else statement? Is there any other method available?
|
prasanth_thavva,
You can only CHECK numeric values within a IFTHEN in JCL.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
superk Advanced

Joined: 19 Dec 2002 Posts: 684 Topics: 5
|
Posted: Wed Apr 18, 2007 9:58 am Post subject: |
|
|
You'll need a program to check the value of OPTION and set a RETURN-CODE value appropriately. Then:
Code: |
//* CHECK VALUE OF OPTION. IF IT IS 'A', THEN SET RC=0. ELSE,
//* SET RC=4.
//CHECK EXEC PGM=XXXX,PARM='&OPTION'
//*
// IF (CHECK.RC=0) THEN
//STEP1 EXEC PGM=PROG1
// ELSE
//STEP2 EXEC PGM=PROG2
// ENDIF
|
|
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Apr 18, 2007 10:03 am Post subject: |
|
|
IF-THEN-ELSE is to do with condition code checking, nothing else. You would need a 4th program that would run first - read the otion and set a return code accordingly. Your IF can then use this RC. I presume your 'step' 2 actually executes a procedure consisting of 2 program steps - a step can only execute ione program. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
prasanth_thavva Beginner

Joined: 14 May 2006 Posts: 40 Topics: 18
|
Posted: Wed Apr 18, 2007 2:08 pm Post subject: |
|
|
Hi,
Its working thanks a lot _________________ Thanks&Regards
Prasanth Thavva |
|
Back to top |
|
 |
kirank Beginner
Joined: 21 Apr 2004 Posts: 61 Topics: 33 Location: hyderabad
|
Posted: Wed Oct 24, 2007 3:47 am Post subject: |
|
|
Hi SuperK
Could you please let me know after reading the value of OPTION in the program, how to set the RETURN-CODE value appropriately.
Thanks & Regards,
kirank. |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Oct 24, 2007 12:23 pm Post subject: |
|
|
Kirank
That is a programming question, a new thread and not JCL.
But, seeing as it is now here: Which language are you using because setting the return code varies from language to language? _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
kirank Beginner
Joined: 21 Apr 2004 Posts: 61 Topics: 33 Location: hyderabad
|
Posted: Thu Oct 25, 2007 12:37 am Post subject: |
|
|
Hi
Sorry for the wrong posting.. Here i'm using COBOL. Shall i go ahead and post the question in correct thread.
Thanks
Kirank. |
|
Back to top |
|
 |
vkphani Intermediate

Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Thu Oct 25, 2007 2:13 am Post subject: |
|
|
Hi all,
I have a suggestion to control step-execution:
Quote: |
There are 3 programs: 1, 2 and 3.
Step 1 executes program 1.
Step 2 executes programs 2 & 3.
There is a variable called as _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay) |
|
Back to top |
|
 |
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Thu Oct 25, 2007 1:53 pm Post subject: |
|
|
If you did that - why not just have one file? Put data into it if OPTION is A otherwise just open/close it. IDCAMS reads it and it is either populated or empty and the return code is set accordingly. But you still have to have a program that reads the option so why complicate things with extra files? Just set the RC dependent on the option value. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
 |
vivek1983 Intermediate

Joined: 20 Apr 2006 Posts: 222 Topics: 24
|
Posted: Fri Oct 26, 2007 1:56 am Post subject: |
|
|
Nic Clouston,
Quote: |
But you still have to have a program that reads the option so why complicate things with extra files? Just set the RC dependent on the option value.
|
Yep ! I agree !! _________________ Vivek G
--------------------------------------
A dream is just a dream. A goal is a dream with a plan and a deadline. (Harvey Mackay) |
|
Back to top |
|
 |
|
|
|
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
|
|