Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 7315

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: 755
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: 1009
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: 241
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: 509
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: 509
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: 8033
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: 755
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 JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Omegamon for DB2 query ashek15 DB2 0 Wed Feb 15, 2017 11:25 am
No new posts Query on DB2 WLM stored procedures ashek15 DB2 8 Sun Feb 12, 2017 11:13 pm
No new posts GETMAIN / FREEMAIN versus STORAGE OBT... steve-myers PL/I & Assembler 8 Wed Feb 01, 2017 1:45 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us