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

GETMAIN/FREEMAIN query


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

New User


Joined: 26 Sep 2008
Posts: 12
Location: Bangalore

PostPosted: Tue Jan 31, 2017 12:01 pm
Reply with quote

Hi,

If we use Getmain to get the memory space of maximum length of the output response array container (say 100) and then populate the output response array container with only 10 records. Will issuing a freemain, freeup all the remaining 89 records of freespace? Or will it just free-up the space acquired by getmain command?

Please clarify.

Thanks,
Suja
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: Tue Jan 31, 2017 2:47 pm
Reply with quote

What did you understand, or require clarification of, from the documentation?
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Tue Jan 31, 2017 3:36 pm
Reply with quote

@ Suja.Sai

With the GETMAIN instruction you obtain a contiguous block of virtual storage. So you requests a certain amount of storage space.
With the FREEMAIN command you release this storage.

See also STORAGE OPTAIN/RELEASE instructions in the manuals.

STORAGE OBTAIN/RELEASE -> uses PC(Program Call)
GETMAIN/FREEMAIN -> uses SVC

It was said that a PC instruction would be much more efficient than a SVC interruption.

Regards, UmeySan
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1306
Location: Vilnius, Lithuania

PostPosted: Tue Jan 31, 2017 3:40 pm
Reply with quote

Bill Woodger wrote:
What did you understand,


That 89+10 = 100...

Sheesh...
Back to top
View user's profile Send private message
dneufarth

Active User


Joined: 27 Apr 2005
Posts: 419
Location: Inside the SPEW (Southwest Ohio, USA)

PostPosted: Tue Jan 31, 2017 8:06 pm
Reply with quote

Thank you Robert. I'm still laughing. Made my day get off to a great start.
Back to top
View user's profile Send private message
Suja.Sai

New User


Joined: 26 Sep 2008
Posts: 12
Location: Bangalore

PostPosted: Tue Jan 31, 2017 8:24 pm
Reply with quote

Sorry, that was a typo.

Thanks a lot Umeysen for the clarification.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Tue Jan 31, 2017 10:05 pm
Reply with quote

UmeySan wrote:
STORAGE OBTAIN/RELEASE -> uses PC(Program Call)
GETMAIN/FREEMAIN -> uses SVC

It was said that a PC instruction would be much more efficient than a SVC interruption.
That's a lie.

As an experiment, I ran a comparable run of GETMAIN/FREEMAIN and repeated it with STORAGE OBTAIN/STORAGE RELEASE. STORAGE OBTAIN/STORAGE RELEASE required substantially more CPU time than GETMAIN/FREEMAIN.
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 917
Location: The Universe

PostPosted: Wed Feb 01, 2017 1:32 am
Reply with quote

Arguably this is not a suitable discussion in a CICS forum, since one should not use GETMAIN/FREEMAIN in CICS - at least not directly. I will prepare a suitable topic in the PL/I / Assembler forum with a test program to demonstrate my contention.
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: Wed Feb 01, 2017 1:45 am
Reply with quote

As a reminder, GETMAIN and FREEMAIN are part of the CICS API and don't really have anything to do with the GETMAIN / FREEMAIN macros.

Did you read the description of EXEC CICS FREEMAIN in the Application Development Reference manual in the CICS bookshelf for your version of CICS? If so, did you miss the statement in the FREEMAIN description (from the 5.3 version):
Quote:
The length of storage released is the length obtained by the GETMAIN request.
If you do a FREEMAIN, you'd better be through with that storage because it won't be there any more -- not even the 10 records you put in.
Back to top
View user's profile Send private message
UmeySan

Active Member


Joined: 22 Aug 2006
Posts: 771
Location: Germany

PostPosted: Wed Feb 01, 2017 5:01 pm
Reply with quote

@ Robert

Your right sir, for CICS i also remenber a GETMAIN64/FREEMAIN64 command for use in non LE. Never used them.

@ Robert

Thats only what i heard an read about it. Fair and square, with theese mips today, i don't give a shit about a second more or less. My two pennies worth.

Regards, UmeySan
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 RC query -Time column CA Products 3
No new posts Dynamically pass table name to a sele... DB2 2
No new posts Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Issue with EXEC CICS QUERY SECURITY c... CICS 6
Search our Forums:

Back to Top