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
 

 

Run units in COBOL batch

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Eshwar CICS

New User


Joined: 18 May 2011
Posts: 47
Location: India

PostPosted: Fri Sep 23, 2011 8:41 pm    Post subject: Reply to: Called program sends a map !
Reply with quote

Related to the same post, RUN UNITs are created in CICS ;

1. Whenever CICS executes the program for a transaction
or
2. A module is linked to
or
3. A module is XCTLed to

Is it possible to create RUN-UNITs in COBOL during batch executions?

Please let me know if this has to be started as new POST.
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Sep 23, 2011 8:47 pm    Post subject: Reply to: Called program sends a map !
Reply with quote

RUN-UNIT's in CICS are Task's, unless programs within the task are issuing SYNCPOINTS (give me a good reason to override DTB), then the RUN-UNIT can become fractured (UOW coronary).

But still, a TASK is defined as a RUN-UNIT until task termination....

Mr. Bill
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Fri Sep 23, 2011 9:02 pm    Post subject:
Reply with quote

Bill, from the CICS Applicaiton Programming Guide:
Quote:
| 1.4.4 Mixing languages



| A run unit is a running set of one or more programs that communicate with
| each other by COBOL static or dynamic CALL statements. In a CICS
| environment, a run unit is entered at the start of a CICS task, or invoked
| by a LINK or XCTL command. A run unit can be defined as the execution of a
| program defined by a PROGRAM resource definition, even though for dynamic
| CALL, the subsequent PROGRAM definition is needed for the called program.

A batch program in COBOL is a run unit -- but based upon the LE definition in the LE Vendor Interface manual, .
Quote:
Run unit
A statically and/or dynamically bound running set of one or more programs (defined below) that communicate with each other by CALL statement. In a CICS environment, a run unit is called at the start of a CICS task (triggered by entering a transaction ID at the terminal) or by issuing EXEC CICS LINK or EXEC CICS XCTL commands from another run unit. Each run unit has its own Language Environment environment.
it does not appear you can have mutliple run units in batch -- at least not without using LE runtime calls to set one up.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7241

PostPosted: Fri Sep 23, 2011 9:07 pm    Post subject: Re: Reply to: Called program sends a map !
Reply with quote

Eshwar CICS wrote:
[...]
Is it possible to create RUN-UNITs in COBOL during batch executions?

Please let me know if this has to be started as new POST.


One of those times to be clear about what you are interested in achieving, rather then floundering around with terminology.

What do you want to do?

Yes, it would have been better as a new post. Perhaps do that with the re-wording, unless a moderator beats you to it.
Back to top
View user's profile Send private message
Eshwar CICS

New User


Joined: 18 May 2011
Posts: 47
Location: India

PostPosted: Fri Sep 23, 2011 9:09 pm    Post subject:
Reply with quote

Bill,

This forum is a great place where i have learned & continue to learn from experts like you. Your initial reply to this post shows the Ocean of knowledge which you have gained with your experience.Thanks for sharing your knowledge.

Robert,
In past we had a unique need in COBOL batch program, where creating RUN-UNITs as in CICS was needed.But we didnt find a way of doing that.Thanks for the confirmation.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7914
Location: Bellevue, IA

PostPosted: Fri Sep 23, 2011 9:19 pm    Post subject:
Reply with quote

Eshwar: from the LE Application Programming Guide:
Quote:
5.4.1 Understanding the basics

In Language Environment, you can use the following methods to create a child enclave:

Under CICS, the EXEC CICS LINK and EXEC CICS XCTL commands (see CICS Application Programming Guide for more information about these commands).

Under z/OS, the SVC LINK macro

Under z/OS, the C system() function (see z/OS XL C/C++ Programming Guide for more information about system()).

Under z/OS, the PL/I FETCH and CALL to any of the following PL/I routines with PROC OPTIONS(MAIN) specified:

Enterprise PL/I for z/OS
PL/I for MVS & VM
OS PL/I Version 2
OS PL/I Version 1 Release 5.1
Relinked OS PL/I Version 1 Release 3.0 - 5.1

Such a routine, called a fetchable main in this book, can only be introduced by a FETCH and CALL from a PL/I routine. COBOL cannot dynamically call a PL/I main and C cannot issue a fetch() against a PL/I main. In addition, a fetchable main cannot be dynamically loaded using the CEELOAD macro.

The routine performing the FETCH and CALL must be compiled with the Enterprise PL/I for z/OS or the PL/I for MVS & VM compiler, or be a relinked OS PL/I routine.

If the target routine of any of these commands is not written in a Language Environment-conforming HLL or Language Environment-conforming assembler, no nested enclave is created.
So it appears if you want to do this in COBOL, you have to write an interface to C, PL/I, or Assembler.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Sep 23, 2011 9:43 pm    Post subject: Reply to: Run units in COBOL batch
Reply with quote

Robert,

OK, I stand corrected.

Should have consulted the doc (again).... icon_rolleyes.gif

Mr. Bill
Back to top
View user's profile Send private message
Gijz

New User


Joined: 27 Nov 2007
Posts: 9
Location: The Netherlands

PostPosted: Mon Oct 10, 2011 9:35 pm    Post subject:
Reply with quote

Eshwar CICS wrote:

In past we had a unique need in COBOL batch program, where creating RUN-UNITs as in CICS was needed.But we didnt find a way of doing that.Thanks for the confirmation.


Eshwar,
This you can do by using the External CICS Interface (EXCI). With the help of EXCI you can start CICS transaction(s) from your batch program, creating a separate RUN-UNIT every time. Mind you the processing is synchronous, meaning the batch program will pause processing until the CICS task has ended and given back a reponse. If you want several RUN-UNIT's active simultaneously you would have to issue START TRANSID's from your started transaction/task.

Currently I'm programming a one-off batch program whereby I need to execute an already programmed CICS function several times.
Back to top
View user's profile Send private message
Eshwar CICS

New User


Joined: 18 May 2011
Posts: 47
Location: India

PostPosted: Tue Oct 11, 2011 10:16 am    Post subject: Reply to: Run units in COBOL batch
Reply with quote

Thanks Gijz.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Tue Oct 11, 2011 12:56 pm    Post subject:
Reply with quote

glad I did not respond.

had no idea that he wanted to invoke a CICS transaction from Batch.
Back to top
View user's profile Send private message
Eshwar CICS

New User


Joined: 18 May 2011
Posts: 47
Location: India

PostPosted: Tue Oct 11, 2011 1:04 pm    Post subject: Reply to: Run units in COBOL batch
Reply with quote

My requirement of creating RUN-UNITs was purely in Batch, for which Robert Sample has provided the best direction.
Said thanks to Gijz because he explained how this can be accomplished when BATCH - CICS coordinate in processing.
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 How does a called pgm know if its cal... Graeme Westerman COBOL Programming 4 Tue Nov 29, 2016 9:25 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
This topic is locked: you cannot edit posts or make replies. MIPS reduction for Batch job Virendra Shambharkar All Other Mainframe Topics 8 Mon Nov 07, 2016 4:02 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm
No new posts COBOL Version 6.1 Virendra Shambharkar COBOL Programming 5 Tue Nov 01, 2016 11:24 am


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