View previous topic :: View next topic
|
Author |
Message |
asagar
New User
Joined: 11 Jul 2012 Posts: 10 Location: Honduras
|
|
|
|
I am writing a Cobol batch program which calls 3 sub-programs. I want to use a control card in the JCL, which gives me an option to call selected sub-programs. Something like 'YNN' would call only the first sub-program, and 'YYY' would call all three.
Please advise |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
If you are asking is this a good control scheme, then think about:
1. future mods, with maybe more subroutines
2. readability to whoever inherits this from you - perhaps the control card can actually name each subroutine to be called |
|
Back to top |
|
|
Peter cobolskolan
Active User
Joined: 06 Feb 2012 Posts: 104 Location: Sweden
|
|
|
|
Google PARAMETER COBOL JCL and you will find "how to".
Rest is simple programming logic. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What's the reasoning behind this?
Is this for production? If so, is the Audit department happy with execution of sub-programs depending on control cards? |
|
Back to top |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
What do these sub-programs do?
I would think the actual input data you are processing would drive which sub programs to call. |
|
Back to top |
|
|
asagar
New User
Joined: 11 Jul 2012 Posts: 10 Location: Honduras
|
|
|
|
The sub-programs do unload for tables, these are for ad-hoc runs in test |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
You can use the Y/N scheme for only a few called modules, but this may become unmanagable when the number grows . . .
Suggest you consider using a "control file" (or member in an existing pds that is used for sontrol data) that contains one record for each sub-module to call - if you intend to do this thru called modules.
Peresonally, i'd probably read the control file and generate the jcl and control statements to do the unloads so that i would not have to include all of the jcl for all of the unloads in one step. . . fwiw. |
|
Back to top |
|
|
Jose Mateo
Active User
Joined: 29 Oct 2010 Posts: 121 Location: Puerto Rico
|
|
|
|
Good day to all!
I think using jcl parameter or control cards for your purpose is well and done. Using a control file is more well design but more work has to be done. If you could control the sub-routines by the format of your input or some field in the input then that's the best way to go. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Yes, there would be a bit more work to process the "control cards" but very little more.
If i understand, the "parm data" is the input and is to control which unloads are to be run. Possibly i mis-understand. |
|
Back to top |
|
|
nalini_s_in
New User
Joined: 05 Jun 2007 Posts: 5 Location: coimbatore
|
|
|
|
you can also code in program by setting return codes for each subprograms.So in JCL based on the return code you can set cond codes so that it bypasses the remaing steps and submits only the step which is required. |
|
Back to top |
|
|
|