Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Using Control Card for Sub-Programs

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Using Control Card for Sub-Programs
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

Active Member


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

PostPosted: Thu Aug 09, 2012 6:02 pm    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Aug 09, 2012 6:20 pm    Post subject: Reply to: Using Control Card for Sub-Programs
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: 683
Location: Pennsylvania

PostPosted: Thu Aug 09, 2012 6:31 pm    Post subject:
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    Post subject:
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

Site Director


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

PostPosted: Thu Aug 09, 2012 7:34 pm    Post subject:
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: 111
Location: Puerto Rico

PostPosted: Thu Aug 09, 2012 7:52 pm    Post subject: Reply to: Using Control Card for Sub-Programs
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

Site Director


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

PostPosted: Thu Aug 09, 2012 8:15 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts pointers on using USS and C programs. Pedro All Other Mainframe Topics 0 Wed Oct 04, 2017 4:38 am
No new posts PLI - printing from multiple programs Pedro PL/I & Assembler 8 Fri Sep 08, 2017 6:36 am
No new posts Changing sort Card Dynamically vickey_dw DFSORT/ICETOOL 5 Sat Aug 19, 2017 2:33 pm
No new posts PA02 - Programmtically control attent... dodithegreat IMS DB/DC 1 Thu Apr 06, 2017 8:33 pm
No new posts Why myself doing Package Bind always ... Susanta DB2 5 Thu Mar 02, 2017 10:47 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us