View previous topic :: View next topic
|
Author |
Message |
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
Hi all,
Can We execute the same step more than once in mvs jcl?
Please give your suggestions. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
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 |
|
|
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
Anuj,
the problem is, the no. of times the program step should be executed is not known. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
I think that you need to clearly lay out the processing logic here of exactly what happens and why |
|
Back to top |
|
|
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
sathish1760
New User
Joined: 02 May 2008 Posts: 42 Location: chennai
|
|
|
|
for checking the existance of file, i have written a common proc in rexx |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
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 |
|
|
Peter Poole
New User
Joined: 07 Jan 2009 Posts: 50 Location: Scotland
|
|
|
|
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 |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
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 |
|
|
MBabu
Active User
Joined: 03 Aug 2008 Posts: 400 Location: Mumbai
|
|
|
|
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 |
|
|
Peter Poole
New User
Joined: 07 Jan 2009 Posts: 50 Location: Scotland
|
|
|
|
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 |
|
|
|