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

CICS online code to be used for both online and Batch


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Fri Aug 29, 2008 11:22 pm
Reply with quote

Hi

I have CICS online program. My requirement is to covert it into subroutine so that i can be called from my online program as well as the batch program. Can anyone give me any inputs on this?
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Fri Aug 29, 2008 11:51 pm
Reply with quote

As long as the program doesn't issue CICS-Only commands or Batch-Only commands, it can be called (via a CALL USING), from either CICS or Batch.

For example, if the sub-program is called to perform some sort of in-house interest calculation, then this would be a "shared" module.

By chance, will this "shared" sub-program be statically (not dynamically) calling an Assembler sub-program?

There's a reason I ask....

Regards,

Bill
Back to top
View user's profile Send private message
Ramya A

Active User


Joined: 26 Jul 2004
Posts: 104

PostPosted: Sat Aug 30, 2008 12:46 am
Reply with quote

I've seen a similar case in my previous shop. There we have 2 different libraries for online and batch copybooks. So, this is what we did:

Place all the CICS-only commands in one set of CICS copybooks. The batch counterpart for those commands should be stored in the BATCH copybooks - with the same names as the CICS copybooks.

Now, this module will act as CICS pgm when called from another CICS pgm and batch when called from another batch pgm.

I'm not sure how far this would work in your shop...
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Sat Aug 30, 2008 6:35 am
Reply with quote

Thanx Bill and Ramya..

How can i convert a DELETEQ/WRITEQ CICS calls to normal COBOL code?
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Sat Aug 30, 2008 6:36 am
Reply with quote

what does your CICS online program do that you need to call it from batch?

Does it contain any EXEC CICS COMMAND statements ?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sat Aug 30, 2008 6:12 pm
Reply with quote

Only thing that I can add (positive) is to decide if you are a Dynamic or Static Link shop. If you are dynamic, insure the batch generated module is dynamically callable.

The shop I work at presently, generates a statically callable only batch module which is one-pain-in-the-butt when you have many modules that call the sub-program. everytime you change the subprogram you have to relink all the calling modules.

as Earl indicated, you don't want to have CICS API calls in the batch version.
TSQ reads/deletes need to be done in the CICS module that calls the cics version of the submodule.
Obviously, there is some info contained in the que item, which needs to be supplied by the batch module calling the batch subroutine.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Sat Aug 30, 2008 9:28 pm
Reply with quote

How can i convert a DELETEQ/WRITEQ CICS calls to normal COBOL code?

You can't convert.


Either write your own EXCI interface from batch or consider using a vendor product to perform the deleteq/writeq from batch cobol code.

try>> Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


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

PostPosted: Sat Aug 30, 2008 9:47 pm
Reply with quote

As soon as the "shared" sub-program is invoked, call a sub-program to determine the run-environment. Upon return, if the run-environment is CICS, call an additional sub-program, which will return the ADDRESS OF DFHEIBLK. Then upon return, call another CICS sub-program, which can issue the TSQ commands.

As long as the "shared" sub-program knows the environment and you've established DFHEIBK addressability, you can call subsequent sub-programs, to issue CICS or non-CICS commands.

HTH....

Regards,

Bill
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Sun Aug 31, 2008 1:39 pm
Reply with quote

Deepthy Jose P,

Is your requirement:

1) isolate application code that can be used in batch or cics, without regard to the environment (batch or cics)

or

2) create a module that will use cics api's both from a batch or cics environment.

??
Back to top
View user's profile Send private message
Deepthy Jose P

New User


Joined: 07 Mar 2007
Posts: 40
Location: India

PostPosted: Tue Sep 02, 2008 3:34 am
Reply with quote

My requirement is

1) isolate application code that can be used in batch or cics, without regard to the environment (batch or cics)
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Tue Sep 02, 2008 5:09 am
Reply with quote

Jose,

as indicated earlier , your common applicaiton code CAN NOT execute
CICS commands in batch environment. However, you can wirte your own
EXCI interface to commmunicate with a CICS program from batch
OR purchase some 3rd party vendor software.

Talk to your CICS systems programmers, they should be able
to tell you best approach for your environment.
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 -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts How to get a stack trace on a looping... ABENDS & Debugging 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
Search our Forums:

Back to Top