Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

how to execute steps randomly
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
kokila2004

New User


Joined: 02 Dec 2004
Posts: 4
Location: Chennai

PostPosted: Sat Dec 04, 2004 10:49 am    Post subject: how to execute steps randomly
Reply with quote

I have 5 steps.I want to execute from 2nd step,then 1st,then 4th and then 3rd steps.Is it possible.can anyone clear my doubt.
Back to top
View user's profile Send private message

Aditya Bhardwaj
Warnings : 1

New User


Joined: 02 Nov 2004
Posts: 18
Location: Noida, India

PostPosted: Tue Dec 07, 2004 10:28 am    Post subject: Re: how to execute steps randomly
Reply with quote

As per my knowledge, i don't think that it is possible to execute steps randomly in a JCL. Rather you have to execute it sequentially, and write in the manner you wnat them to be executed.
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Tue Dec 07, 2004 1:48 pm    Post subject:
Reply with quote

It is always asked whether i can execute only odd/even steps of JCL or random steps etc. But it is not possible to do so in JCL. Restart parameter helps you if you need to start executing from certain steps and it is possible to bypass certain steps using COND parameter.

Quote:
I have 5 steps.I want to execute from 2nd step,then 1st,then 4th and then 3rd steps.Is it possible.can anyone clear my doubt.


Why dont you change your Job in that required manner?
Back to top
View user's profile Send private message
veera
Warnings : 1

New User


Joined: 24 Nov 2004
Posts: 20
Location: chennai

PostPosted: Tue Dec 07, 2004 6:17 pm    Post subject:
Reply with quote

[quote="anuradha"]It is always asked whether i can execute only odd/even steps of JCL or random steps etc. But it is not possible to do so in JCL. Restart parameter helps you if you need to start executing from certain steps and it is possible to bypass certain steps using COND parameter.

[quote]I have 5 steps.I want to execute from 2nd step,then 1st,then 4th and then 3rd steps.Is it possible.can anyone clear my doubt.[/quote]

Why dont you change your Job in that required manner?[/quote]


hello,
executing steps randomly by using DPART parames
second way is using IEBEDIT COMMAND.

REGARDS,
VEERA
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Tue Dec 07, 2004 7:05 pm    Post subject:
Reply with quote

Hi Veera,

Can you please describe clearly about the two methods you mentioned.
Back to top
View user's profile Send private message
veera
Warnings : 1

New User


Joined: 24 Nov 2004
Posts: 20
Location: chennai

PostPosted: Tue Dec 07, 2004 11:14 pm    Post subject:
Reply with quote

[quote="anuradha"]Hi Veera,

Can you please describe clearly about the two methods you mentioned.[/quote]
hai anu
it can be solved by using the following two mehods
1. in step card u have to mention the dprty=(val1,val2)
priority=16*val1 +val2 according to result value step will be executed higher number higher priority
2. By using IEBEDIT u have to specify the name after sysin dd *
steps (step10 step2.....) in ur prefered manner
during runtime these r executed as mentioned manner
regs
veera
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Tue Dec 07, 2004 11:28 pm    Post subject:
Reply with quote

Hi veera,

I wonder if coding DPRTY on step name will serve you the purpose. Did u test this?

And regarding IEBEDIT utility iam not aware of this.

Anyway let me check from my part and i will let you know the results.
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Wed Dec 08, 2004 3:17 pm    Post subject:
Reply with quote

Hi veera,

When I am searching about this IEBEDIT utility nowhere i found that this utility is used to execute the steps in a selective manner.

I wonder if you got the result in this way.
Back to top
View user's profile Send private message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Wed Dec 08, 2004 5:29 pm    Post subject: U can do like this also...
Reply with quote

Hey Man,

Try the following method. it may work efficiently.

Create a flat file using ISPF option 3.2 A and enter step numbers which u want to execute.

Eg: 2
5
7
12
and so on.... Then write a Cobol program which reads your source JCL and starts a Step_Counter as 0 ( a WS variable) for each step it is incremented by one. Compare present Step_Counter Value with The Step numbers available in Flat file. If match then copy that step ( read as record) into a new flat file ( will be your result JCL).

Repeat the process for all steps then either manually execute newly generated JCL file or automatically submit using (*,INTRDR) ( refer to previous faq for automatically submitting jcl from cobol).

If u have chance and patience you can create a tool with above specifications. Ok.

End Note: It means I dont have yet.
Back to top
View user's profile Send private message
jz1b0c

Active User


Joined: 25 Jan 2004
Posts: 160
Location: Toronto, Canada

PostPosted: Wed Dec 08, 2004 10:53 pm    Post subject:
Reply with quote

any body has a sample JCL to do this?
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Thu Dec 09, 2004 6:06 pm    Post subject:
Reply with quote

Hi veera,

Where are you man. Why dont you provide the Sample JCl for the two methods which you suggested. But AFAIK coding DPRTY in the step level will just ignore that and i dont think it will give us the solution. But it is appreciable If you provide us the JCL if it works for you.

And one small suggestion from me. Why dont you preview your post before posting. Because i have seen many of your posts have the QUOTES but not in a fine way. and just dont say hello. It is very rude. Its only my suggestion.Hope you will take in a positive sense.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Thu Dec 09, 2004 7:04 pm    Post subject:
Reply with quote

Here is a sample IEBEDIT job as requested that submits a job (JOB1) from steps 2, 1, 4, and 3:
Code:

//JOB0 JOB (T,67423,000),'ME',CLASS=T,MSGCLASS=X,
//     MSGLEVEL=(1,1),NOTIFY=&SYSUID             
//*                                               
//STEP0001 EXEC PGM=IEBEDIT                       
//SYSUT1   DD   DISP=SHR,DSN=&SYSUID..JOB1       
//SYSUT2   DD   SYSOUT=(A,INTRDR)                 
//SYSPRINT DD   SYSOUT=*                         
//SYSIN    DD   *                                 
  EDIT START=JOB1,TYPE=POSITION,STEPNAME=STEP0002
/*                                               
//*                                               
//STEP0002 EXEC PGM=IEBEDIT                       
//SYSUT1   DD   DISP=SHR,DSN=&SYSUID..JOB1       
//SYSUT2   DD   SYSOUT=(A,INTRDR)                 
//SYSPRINT DD   SYSOUT=*                         
//SYSIN    DD   *                                 
  EDIT START=JOB1,TYPE=POSITION,STEPNAME=STEP0001
/*                                               
//*                                                     
//STEP0003 EXEC PGM=IEBEDIT                             
//SYSUT1   DD   DISP=SHR,DSN=&SYSUID..JOB1             
//SYSUT2   DD   SYSOUT=(A,INTRDR)                       
//SYSPRINT DD   SYSOUT=*                               
//SYSIN    DD   *                                       
  EDIT START=JOB1,TYPE=POSITION,STEPNAME=STEP0004       
/*                                                     
//*                                                     
//STEP0004 EXEC PGM=IEBEDIT                             
//SYSUT1   DD   DISP=SHR,DSN=&SYSUID..JOB1             
//SYSUT2   DD   SYSOUT=(A,INTRDR)                       
//SYSPRINT DD   SYSOUT=*                               
//SYSIN    DD   *                                       
  EDIT START=JOB1,TYPE=POSITION,STEPNAME=STEP0003       
/*                                                     
//*                                                     

I coded JOB1 to have 5 steps that just write the stepname to a dataset as proof that the process is working. Here is the results from the dataset:
Code:

JOB JOB1 RAN STEP0002 <= START AT STEP2
JOB JOB1 RAN STEP0003
JOB JOB1 RAN STEP0004
JOB JOB1 RAN STEP0005
JOB JOB1 RAN STEP0001 <= START AT STEP1
JOB JOB1 RAN STEP0002
JOB JOB1 RAN STEP0003
JOB JOB1 RAN STEP0004
JOB JOB1 RAN STEP0005
JOB JOB1 RAN STEP0004 <= START AT STEP4
JOB JOB1 RAN STEP0005
JOB JOB1 RAN STEP0003 <= START AT STEP3
JOB JOB1 RAN STEP0004
JOB JOB1 RAN STEP0005
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Thu Dec 09, 2004 7:37 pm    Post subject:
Reply with quote

Hi Kevin,

The job given by you is almost like starting particular job from particular step right! icon_idea.gif

And my doubt is can we use this utility to execute steps randomly in a selective way. Suppose i want to execute job1 in the following way:
Step2,step4,step1 and then execute step3.Is this possible. I dont think it is. Even i tried to do.But i couldn't. If it is possible please give us the jCL for this.
Back to top
View user's profile Send private message
mprabhuram

New User


Joined: 09 Jun 2005
Posts: 1
Location: Chennai

PostPosted: Thu Jun 09, 2005 10:47 pm    Post subject: Re: how to execute steps randomly
Reply with quote

Hi,

Inorder to run step 6 then 3 then step 11.....

First create a simple program which will read a file and set the return code based on the file... Once the first record is read and return code is set it will then place a flag next to the first record that this step is executed... Afterwards when the program is again called it will check the first record and if there is there is flag it will skip that record and read the next record.... if there is no flag set in the second record it will set the second record content as the return code.....


i.e

Consider the following file as sample....


RETURNCODE STEP EXECUTED STATUS FLAG
----------------FILE START------------------------------------------
6 Y
3
11
----------------FILE END---------------------------------------------


Our jCL should be coded like this



step1
Execute the program which will read the input file and set the rc code as value of RETURNCODE field in the input file. Once the return code is genrated that record is marked as processed (Y)... If there all records were already processed the retun code is set to say 99


if rc=3
execute step3

if rc=6
execute step6

if rc=11
execute step3


if rc <> 99
last step ... submit the same job again through intr reader


So now the job will be submited 3 times as per our example.. and in the first run the program will read the input file and set the rc as 6 .. and it also sets the first records status flag as Y(inorder to skip the 6 step when the job is submitted again through the internal reader) Since the rc is set as 6 only the step 6 will be executed... and at end the last step will again submit the jcl..

When the jcl is submitted again the program is executed again, it has to skip the first record(step 6) since the flag is set as Y(already processed in run 1) and read the next reacord and set the rc as 3..Now only the step 3 will be executed and the whole process will be replicated untill the exit conditon is reached

NOTE : Please let me know if any body knows a better solution...

thanks
Prabhuram Mohan
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 236
Location: Cincinnati OH USA

PostPosted: Fri Jun 10, 2005 4:12 am    Post subject:
Reply with quote

Call me too curious, but has anyone actually ever had to run a job with the steps out of order or randomized other that restarting at a particular step?

This questions appears regularly on several MVS discussion boards and it sounds too much like an interview or classroom question.

I worked in a large insurance company IT shop as well as a large retailer IT shop and I never saw a production problem addressed by executing steps out of order. If a situation required unusual step order, a job was created containing them in the order required, placed in a special JOB library and operations notified that it was ready to execute.

Dave
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Tue Jun 14, 2005 7:03 pm    Post subject:
Reply with quote

Yep Even I agree with you Dave. I bet these are Interview questions. Never we got this kind of situation. And am sure if we get also we go for another job rather than trying in the above ways.
Back to top
View user's profile Send private message
mf_user
Currently Banned

New User


Joined: 05 Jan 2006
Posts: 47

PostPosted: Fri Mar 10, 2006 12:27 pm    Post subject: Re: how to execute steps randomly
Reply with quote

Hi SuperK,

After reading the content from this link, I've created job as shown below and executed it. But it did not executed the steps randomly.

Code:

//USERIDXX JOB (XXXXXX),'TEST JOB',                 
//             CLASS=J,                             
//             MSGCLASS=Y,                         
//             NOTIFY=&SYSUID                       
//*                                                 
//STEP0001 EXEC PGM=IEBEDIT                         
//SYSUT1   DD   DISP=SHR,DSN=&SYSUID..JOB1         
//SYSUT2   DD   SYSOUT=(*,INTRDR)                   
//SYSPRINT DD   SYSOUT=*                           
//SYSIN    DD   *                                   
  EDIT START=JOB1,TYPE=POSITION,STEPNAME=STEP0002   
/*                                                 
//STEP0002 EXEC PGM=IEBEDIT                         
//SYSUT1   DD   DISP=SHR,DSN=&SYSUID..JOB1         
//SYSUT2   DD   SYSOUT=(*,INTRDR)                   
//SYSPRINT DD   SYSOUT=*                           
//SYSIN    DD   *                                   
  EDIT START=JOB1,TYPE=POSITION,STEPNAME=STEP0001   
/*                                               
//STEP0003 EXEC PGM=IEBEDIT                       
//SYSUT1   DD   DISP=SHR,DSN=&SYSUID..JOB1       
//SYSUT2   DD   SYSOUT=(*,INTRDR)                 
//SYSPRINT DD   SYSOUT=*                         
//SYSIN    DD   *                                 
  EDIT START=JOB1,TYPE=POSITION,STEPNAME=STEP0004
/*                                               
//STEP0004 EXEC PGM=IEBEDIT                       
//SYSUT1   DD   DISP=SHR,DSN=&SYSUID..JOB1       
//SYSUT2   DD   SYSOUT=(*,INTRDR)                 
//SYSPRINT DD   SYSOUT=*                         
//SYSIN    DD   *                                 
  EDIT START=JOB1,TYPE=POSITION,STEPNAME=STEP0003
/*                                               
//                                               


And, in the &SYSUID..JOB1 (USERIDXX.JOB1) dataset I put the following content.

Code:

//USERIDXX JOB (XXXXXX),'TEST JOB',
//             CLASS=J,             
//             MSGCLASS=Y,         
//             NOTIFY=&SYSUID       
//*                                 
//STEP0001 EXEC PGM=IEFBR14         
//*                                 
//STEP0002 EXEC PGM=IEFBR14         
//*                                 
//STEP0003 EXEC PGM=IEFBR14         
//*                                 
//STEP0004 EXEC PGM=IEFBR14         
//*                                 
//STEP0005 EXEC PGM=IEFBR14         
//*                                 


The spool has shown the following:

Code:

                IEBEDIT LISTING                   
   EDIT START=JOB1,TYPE=POSITION,STEPNAME=STEP0002
 IEB022I  JOB NAME NOT FOUND BEFORE END OF FILE   
 IEB024I  4 WAS HIGHEST SEVERITY CODE             


Please help me in understanding this.

Thanks a lot.
Back to top
View user's profile Send private message
Thiruppathi

New User


Joined: 12 Mar 2006
Posts: 2
Location: memphis,TN, USA

PostPosted: Sun Mar 12, 2006 7:19 pm    Post subject: Re: how to execute steps randomly
Reply with quote

you can code step1 step3 step4 and step2 in JCl
Back to top
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 287
Location: Basel, Switzerland

PostPosted: Mon Mar 13, 2006 3:05 pm    Post subject:
Reply with quote

hy,

dneufarth is very right,
use the most easiest way to find a solution.
thanks for your experience.

martin9
Back to top
View user's profile Send private message
sudheer_kumar

New User


Joined: 27 Dec 2005
Posts: 16

PostPosted: Mon Mar 13, 2006 6:07 pm    Post subject:
Reply with quote

Sample JCL for random execution of Steps
************************************

//JOBNAME JOB (T,DH,STK),' '
//ISTEP1 EXEC PGM=IEBEDIT
//SYSUT1 DD DSN=WORK.SOURCE(IEBE2JOB),DISP=SHR
//SYSUT2 DD SYSOUT=(*,INTRDR)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
EDIT START=TIEBEDJ,TYPE=INCLUDE,STEPNAME=STEP2,STEP1,STEP4,STEP3
//

Contents of 'WORK.SOURCE(IEBE2JOB)' were as follows:
****************************************************

//TIEBEDJ JOB (T,FA,STK),....
//STEP1 EXEC PGM=IEFBR14
//DD1 DD DUMMY
//STEP2 EXEC PGM=IEFBR14
//DD2 DD DUMMY
//STEP3 EXEC PGM=IEFBR14
//DD3 DD DUMMY
//STEP4 EXEC PGM=IEFBR14
//DD4 DD DUMMY
//STEP5 EXEC PGM=IEFBR14
//DD5 DD DUMMY
//
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts execute APP if they are not ADDRESS T... italo_pm CLIST & REXX 3 Fri Aug 12, 2016 2:15 am
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
No new posts CEXEC not able to execute if no SLINE... boyti ko CLIST & REXX 2 Wed Apr 13, 2016 4:31 pm
This topic is locked: you cannot edit posts or make replies. Executing JCL specific steps at speci... Shruti Takkar JCL & VSAM 6 Mon Feb 22, 2016 12:39 pm
No new posts CALL MACRO EXECUTE FORM - Setting the... sudarshan.srivathsav PL/I & Assembler 7 Tue Feb 09, 2016 10:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us