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
 

 

Can We execute the same step more than once in mvs jcl?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Mon Feb 09, 2009 12:02 pm    Post subject: Can We execute the same step more than once in mvs jcl?
Reply with quote

Hi all,

Can We execute the same step more than once in mvs jcl?

Please give your suggestions.
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Feb 09, 2009 12:10 pm    Post subject:
Reply with quote

Hello,

No. We can't. Once executed, the step is gone.

If you explain your requirement, someone may be able to suggest a way to do what you need.
Back to top
View user's profile Send private message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Mon Feb 09, 2009 12:22 pm    Post subject:
Reply with quote

dick,

my requirement is that i ll b passing one file name as an input to the cobol program.. in the program execution step,the file name(last qualifier) will be changed by the program.. in the next JCL step i will be checking whether the file is empty or not .. if it is not empty , i will be executing the program step again. untill i get a empty file, thae above said process will be continued
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Feb 09, 2009 4:04 pm    Post subject:
Reply with quote

Hi,

If the file name is been managed to change then it is no longer the same file - you might consider to execute the same program multiple times in different steps.
Back to top
View user's profile Send private message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Mon Feb 09, 2009 4:55 pm    Post subject:
Reply with quote

Anuj,
the problem is, the no. of times the program step should be executed is not known.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Feb 09, 2009 5:00 pm    Post subject: Reply to: Can We execute the same step more than once in mvs
Reply with quote

Hi,

Two options I can think of:

1. Problem is too complex to be handled in Mianframes..
2. You are not being able to decribe the problem properly. Start over & let us know what do you want to do? What you posted in other post seems to be a way to achieve what you want; but I believe it's not the only solution, once the problem is understood well - some one will be around to offer better suggestions.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 09, 2009 5:03 pm    Post subject:
Reply with quote

I think that you need to clearly lay out the processing logic here of exactly what happens and why
Back to top
View user's profile Send private message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Mon Feb 09, 2009 5:30 pm    Post subject:
Reply with quote

Hi all,

i m working in conversion project.the scenario given in the client environment is,

1.A file(A.B.C01) is given as an input to the cobol pgm.

2.After the execution of cobol 'program step', the file name will be changed(A.B.C02).

3.In the next JCL step,We will check whether the file(A.B.C02) exists in the catalog.

4.If the the file exists,the 'program step' has to be executd again.Else the job should be ended.

5.The file name will be changed(A.B.C03) again after the execution of 'program step'. once again the file is checked for the exixtence in the catalog and the 'program step' will be executed. this will happen until an uncatalogued file comes as an ouput of 'program step'
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7904
Location: Bellevue, IA

PostPosted: Mon Feb 09, 2009 6:00 pm    Post subject:
Reply with quote

Are you running under JES2 or JES3? JES3 does data set allocation before starting the job, so you only get one check to see if the file exists.
Back to top
View user's profile Send private message
sathish1760

New User


Joined: 02 May 2008
Posts: 42
Location: chennai

PostPosted: Mon Feb 09, 2009 6:02 pm    Post subject:
Reply with quote

for checking the existance of file, i have written a common proc in rexx
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Feb 09, 2009 6:07 pm    Post subject:
Reply with quote

what does the cobol program do with the data in the input file?
What does it do with records not output?
Why are some records output and others are not?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Mon Feb 09, 2009 6:09 pm    Post subject:
Reply with quote

Or,

have this COMMON proc that you use to check on the existance of a file, generate the necessary JCL and submit the job (with different DSN).

It would not be multiple steps of a job, it would be multiple jobs.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Feb 09, 2009 6:37 pm    Post subject:
Reply with quote

Or use a GDG and process the base, delete at end of process, and then set up a null +1 to stop the next cycle failing JCL error.
Back to top
View user's profile Send private message
Peter Poole

New User


Joined: 07 Jan 2009
Posts: 50
Location: Scotland

PostPosted: Mon Feb 09, 2009 11:24 pm    Post subject:
Reply with quote

As I recall, reading the GDG base will concatenate all generations as one input file, which may not be what is needed.

From info so far, I'd go with having an exec to query which files exist then build and submit the job dynamically. Set the execution up as an instream proc with the DSN as a symbolic variable, then 'all' you need to do is copy the 'exec procname, indsn=dname' line a few times and still end up submitting a single job.

It's slightly unusual - in my experience - to have a job where you don't know many input files there might be, unless these are a number of transmitted files built up over a period. If that is the case, you might look at using scheduling software to process each file as it arrives, either by datasetname or as generation 0 of a GDG. Suggest you discuss with the Ops Analysts at your site before you go re-inventing the wheel...

Cheers.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1703
Location: Australia

PostPosted: Tue Feb 10, 2009 4:20 am    Post subject:
Reply with quote

Hi,

why not have the cobol program set the return code, ie. 0 if file is empty and 1 if not empty.

Now if return code is 1, rerun the job.


Gerry
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Tue Feb 10, 2009 9:50 am    Post subject: Reply to: Can We execute the same step more than once in mvs
Reply with quote

Why do these steps need to be called directly from JCL as individual steps? Use a scripting language like Rexx. That is what Rexx is for and it should be almost trivial to write this sequence. It sounds like a simple loop checking for the data set, invoking a program, changing the data set name and running the loop until the data set does not exist. Trying to do this as individual steps of JCL will make you (and your team) go insane.
Back to top
View user's profile Send private message
Peter Poole

New User


Joined: 07 Jan 2009
Posts: 50
Location: Scotland

PostPosted: Tue Feb 10, 2009 4:42 pm    Post subject:
Reply with quote

The expanded spec (# 8 above) indicates he cares if the file exists or not, not if it's empty or not...

I'd say it's all down to the context of what he's trying to do and why. ("PhD in stating the bleeding obvious", anyone?)

If there are a finite number of pre-existing files that fill up sequentially over a period of time then get mass re-defined for the next cycle, then process all of them and stop as you suggest when you hit an empty one...

If this is a production job, he needs to talk to his OA people though.

Cheers.
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
Page 1 of 1

 

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 Converting multiple VB files to FB fi... Viswanath Reddy JCL & VSAM 6 Mon Aug 08, 2016 11:49 pm
No new posts Execute multiple DB2 Load commands in... faizm DB2 4 Wed Aug 03, 2016 12:53 pm
This topic is locked: you cannot edit posts or make replies. JCL MULTIPLE STEP EXECUTION QUERY Susanta JCL & VSAM 18 Sat Jul 30, 2016 1:17 pm
No new posts Single step utility for compare and u... ramprakashn JCL & VSAM 5 Fri Apr 29, 2016 3:43 pm


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