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

Using Control Card for Sub-Programs


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
asagar

New User


Joined: 11 Jul 2012
Posts: 10
Location: Honduras

PostPosted: Thu Aug 09, 2012 5:55 pm
Reply with quote

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
View user's profile Send private message
Phrzby Phil

Senior Member


Joined: 31 Oct 2006
Posts: 1042
Location: Richmond, Virginia

PostPosted: Thu Aug 09, 2012 6:02 pm
Reply with quote

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
View user's profile Send private message
Peter cobolskolan

Active User


Joined: 06 Feb 2012
Posts: 104
Location: Sweden

PostPosted: Thu Aug 09, 2012 6:04 pm
Reply with quote

Google PARAMETER COBOL JCL and you will find "how to".
Rest is simple programming logic.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Aug 09, 2012 6:20 pm
Reply with quote

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
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Aug 09, 2012 6:31 pm
Reply with quote

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
View user's profile Send private message
asagar

New User


Joined: 11 Jul 2012
Posts: 10
Location: Honduras

PostPosted: Thu Aug 09, 2012 7:18 pm
Reply with quote

The sub-programs do unload for tables, these are for ad-hoc runs in test
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: Thu Aug 09, 2012 7:34 pm
Reply with quote

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
View user's profile Send private message
Jose Mateo

Active User


Joined: 29 Oct 2010
Posts: 121
Location: Puerto Rico

PostPosted: Thu Aug 09, 2012 7:52 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Thu Aug 09, 2012 8:15 pm
Reply with quote

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
View user's profile Send private message
nalini_s_in

New User


Joined: 05 Jun 2007
Posts: 5
Location: coimbatore

PostPosted: Fri Aug 10, 2012 7:12 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Fetch data from programs execute (dat... DB2 3
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts Finding Assembler programs PL/I & Assembler 5
Search our Forums:

Back to Top