View previous topic :: View next topic
|
Author |
Message |
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
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 |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
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 |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
dejunzhu
Active User
Joined: 08 May 2008 Posts: 390 Location: China
|
|
|
|
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
You didn't mention you had a multi run-environment.
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 |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
|
|
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 |
|
|
|