IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Mon Feb 09, 2009 12:10 pm
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
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

Superior Member


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

PostPosted: Mon Feb 09, 2009 4:04 pm
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
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

Superior Member


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

PostPosted: Mon Feb 09, 2009 5:00 pm
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: 8797
Location: Welsh Wales

PostPosted: Mon Feb 09, 2009 5:03 pm
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
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon Feb 09, 2009 6:00 pm
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
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
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
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: 8797
Location: Welsh Wales

PostPosted: Mon Feb 09, 2009 6:37 pm
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
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: 1702
Location: Australia

PostPosted: Tue Feb 10, 2009 4:20 am
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: 400
Location: Mumbai

PostPosted: Tue Feb 10, 2009 9:50 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts Return codes-Normal & Abnormal te... JCL & VSAM 7
No new posts How to append a PS file into multiple... JCL & VSAM 3
No new posts Fetch data from programs execute (dat... DB2 3
This topic is locked: you cannot edit posts or make replies. How To Write, Compile and Execute Cob... COBOL Programming 5
Search our Forums:

Back to Top