Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
GETMAIN/FREEMAIN query

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
Suja.Sai

New User


Joined: 26 Sep 2008
Posts: 11
Location: Bangalore

PostPosted: Tue Jan 31, 2017 12:01 pm    Post subject: GETMAIN/FREEMAIN query
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Tue Jan 31, 2017 2:47 pm    Post subject: Reply to: GETMAIN/FREEMAIN query
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: 757
Location: Germany

PostPosted: Tue Jan 31, 2017 3:36 pm    Post subject:
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: 1068
Location: Oostende, Belgium

PostPosted: Tue Jan 31, 2017 3:40 pm    Post subject: Re: Reply to: GETMAIN/FREEMAIN query
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: 255
Location: Cincinnati OH USA

PostPosted: Tue Jan 31, 2017 8:06 pm    Post subject:
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: 11
Location: Bangalore

PostPosted: Tue Jan 31, 2017 8:24 pm    Post subject: Reply to: GETMAIN/FREEMAIN query
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: 586
Location: The Universe

PostPosted: Tue Jan 31, 2017 10:05 pm    Post subject:
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: 586
Location: The Universe

PostPosted: Wed Feb 01, 2017 1:32 am    Post subject:
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: 8189
Location: East Dubuque, Illinois, USA

PostPosted: Wed Feb 01, 2017 1:45 am    Post subject: Reply to: GETMAIN/FREEMAIN query
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: 757
Location: Germany

PostPosted: Wed Feb 01, 2017 5:01 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to query MAXGENS of an existing P... Chuchulo Hatyzak JCL & VSAM 0 Wed Nov 22, 2017 10:23 pm
No new posts Native SQL Query kishpra DB2 1 Wed Nov 22, 2017 8:38 pm
No new posts Query on IEFBR14 with GDG Ashishpanpaliya JCL & VSAM 3 Tue Nov 07, 2017 8:34 pm
No new posts Query on XMITIP abdulrafi All Other Mainframe Topics 1 Wed Oct 25, 2017 6:54 pm
No new posts HEX value search in a DB2 query maxsubrat DB2 2 Wed Oct 04, 2017 3:04 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us