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

Using CICS GETMAIN or calling CEEGTST


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

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Fri Aug 24, 2012 9:57 pm
Reply with quote

I found Language Environment Callable Service CEEGTST also can obtain storage dynamically by COBOL program.

which one is better? Using CICS GETMAIN or calling CEEGTST ?

Would u please advise? and why?

Thanks.
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: Fri Aug 24, 2012 10:02 pm
Reply with quote

New question, new topic please. Many will ignore the question assuming the new post is something related to the original. On top of that, it is just plain confusing.
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 24, 2012 11:59 pm
Reply with quote

To make a long story short, in CICS, use the GETMAIN API. CEEGTST would be a secondary choice, but you'd have to show justification.

As Bill has said, please don't coattail on a previous post.
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 25, 2012 12:18 am
Reply with quote

looking at the manuals will tell you the source and controller of the memory acquired
by the two different dynamic memory allocation routines.

based on
  • from where you want to acquire the storage area
  • what controls the acquired memory
  • the affect on CICS performance
,
you would choose the appropriate mechanism.
Only you know the circumstances of your environment.
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sat Aug 25, 2012 3:55 pm
Reply with quote

as my program is called by both online and batch programs, it cannot contain CICS statements.
so, I have to code compiled CICS statements directly into my program, like below:
Code:
*EXEC CICS                                                       
*    GETMAIN SET (CMLAPCMA-DB-BUFF-PTR (WK-BUF-IDX) )             
*        FLENGTH (CMLSEADR-DB-BUFFER-LEN)                         
*        INITIMG (WK-INITIAL-VALUE)                               
*      NOSUSPEND                                                 
*END-EXEC                                                         
             Call 'DFHEI1' using by content X'0c02b000070000ec00f0
-    'f0f1f5f2404040' by reference CMLAPCMA-DB-BUFF-PTR           
     (WK-BUF-IDX) by content X'0000' by reference WK-INITIAL-VALUE
      by reference CMLSEADR-DB-BUFFER-LEN end-call               
*


have u ever seem this kind of programming?
I mean, is this programming type very bad? it might bring much trouble to maintainers, because it's not readable. furthermore, I'm not sure whether such program is required to be re-compiled with the upgration of hardware/software...

in the light of this, personally, I prefer using CEEGTST.

Please kindly advise. thanks.
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sat Aug 25, 2012 4:25 pm
Reply with quote

All programs are run in CICS region , which is a area managed by CICS, but if I use CEEGTST, storage will be allocated from heap, which might be not within the area of CICS region, right?

If it is so, it might adversely impact on CICS performance.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Sat Aug 25, 2012 5:44 pm
Reply with quote

By reading the manual on CEEGTST, I found that in a CICS region CEEGTST will do a CICS GETMAIN behind the scenes anyway. So by using CEEGTST you're just adding overhead to your GETMAIN.
Back to top
View user's profile Send private message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sat Aug 25, 2012 7:22 pm
Reply with quote

hi, Robert, which manual were you reading when you get the conclusion?

I read <zOS V1R9.0 Language Environment Programming Reference>, but no such result?
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: Sun Aug 26, 2012 1:09 am
Reply with quote

You didn't mention you had a multi run-environment. icon_rolleyes.gif

Programmatically determine your run-environment -

www.ibmmainframes.com/viewtopic.php?p=247556&highlight=#247556

Once you know the environment, save it in a WS field, CALL "CEEGTST" (Batch) or CALL (not LINK-TO) a CICS Sub-Program, (passing 3 fullword placeholder parms) which will establish addressability to the EIB (using the 1st-placeholder parm in an ADDRESS EIB API)), issue a CICS GETMAIN and return the GETMAIN address to the Caller in the 3rd-parm.

Your program's would be isolated from their underlying environment and will not need to be translated as a CICS program. You would compile the Calling programs as if they were Batch COBOL.

As long as you know the run-environment, Batch and CICS functionality can be performed by the use of in-house Called Sub-Programs or LE Callable Service routines, such as "CEEGTST".
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: Mon Aug 27, 2012 3:31 am
Reply with quote

There's one lingering question I have using "CEEGTST" in CICS.

The LE manual states that previous heap storage acquired by "CEEGTST" will be freed at either STEP or JOB termination, by the Operating System.

Because CICS "DFHSIP" is considered an executable STEP, it seems that this heap storage could be orphaned, unless of course there are considerations in the internal CICS code, which handles the freeing of this storage at task termination.

However, if an abend occurs, will the storage be freed?

CICS GETMAINed storage (via the API) is automatically free at task termination, except for GETMAINed SHARED, unless previous (explicitly) FREEMAINed before task termination.
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 Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Calling Java method from batch COBOL ... COBOL Programming 5
No new posts Calling an Open C library function in... CICS 1
No new posts How to 'Ping' a CICS region in JCL CICS 2
Search our Forums:

Back to Top