Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 961
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: 7232

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: 645
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: 110
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 Cobol list of programs being called biswajit.dattagupta COBOL Programming 5 Tue Nov 01, 2016 2:10 am
No new posts Can sending 5 MB data between cobol p... Kevin Vaz CICS 12 Tue Oct 18, 2016 4:50 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
This topic is locked: you cannot edit posts or make replies. Sort card to replace text using cross... Susanta SYNCSORT 32 Tue Sep 13, 2016 4:17 pm
No new posts User exit in COBOL programs ganasrinivasan PL/I & Assembler 0 Thu Aug 18, 2016 12:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us