Alternative for GETMAIN.

HLASM for MVS. PL/I for MVS & Enterprise PL/I for z/OS.
Post Reply
Leena
Registered Member
Posts: 30
Joined: Fri Aug 09, 2013 10:17 pm

Alternative for GETMAIN.

Post by Leena »

Hi,

I am looking for some alternate function for GETMAIN, is there any which can beused in plae of it? Please help.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: Alternative for GETMAIN.

Post by enrico-sorichetti »

Why ?
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Alternative for GETMAIN.

Post by William Collins »

There is, which is to use Language Environment. But Why? is a very good question.
User avatar
Anuj Dhawan
Founder
Posts: 2801
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Alternative for GETMAIN.

Post by Anuj Dhawan »

I do not speak assembler too often, however, for this question I think I've an answer - you can use STORAGE OBTAIN instead of GETMAIN: http://publibz.boulder.ibm.com/cgi-bin/ ... 0118202913 though Why? still is a very good question.

Hope this helps.
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
enrico-sorichetti
Global Moderator
Global Moderator
Posts: 826
Joined: Wed Sep 11, 2013 3:57 pm

Re: Alternative for GETMAIN.

Post by enrico-sorichetti »

telling that You use STORAGE OBTAIN/FREEMAIN is more trendy than telling that You are just a plain user of old plain GETMAIN/FREEMAIN :D

anyway see here about the differences
http://www-01.ibm.com/support/knowledge ... acros_.htm
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort 8-)
Leena
Registered Member
Posts: 30
Joined: Fri Aug 09, 2013 10:17 pm

Re: Alternative for GETMAIN.

Post by Leena »

Thanks for the suggestion, appreciate that.

To answer why, I wanted to learn if there are other ways of doing it that's why I have asked away.

Enrico:: I am sorry but I could find the difference there. When I click on that link I'm taken to http://www-01.ibm.com/support/knowledgecenter/#!/ and searched for STORAGE OBTAIN, GETMAIN but none of them talked about the differences instead it explain about it. May be I did not follow you well.
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1891
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Alternative for GETMAIN.

Post by Robert Sample »

Google is your friend. Googling getmain versus storage obtain returned about 3,520 hits including the first page with this:
Comparison of GETMAIN/FREEMAIN macros with the STORAGE macro

z/OS MVS Programming: Authorized Assembler Services Guide
SA22-7608-17





The decision about whether to use GETMAIN or STORAGE OBTAIN to obtain virtual storage and FREEMAIN or STORAGE RELEASE to release the storage depends on several conditions:
•The address space control (ASC) mode of your program. If it is in AR mode, use the STORAGE macro.
•The address space that contains the storage your program wants to obtain or release. If the storage is in an address space other than the primary, use the STORAGE macro.
•Whether the program requires a branch entry or a stacking PC entry to the macro service. Using the branch entry on the GETMAIN or FREEMAIN macro is more difficult than using the STORAGE macro. Therefore, you might use STORAGE OBTAIN instead of GETMAIN for ease of coding, for example, when your program: ◦Is in SRB mode
◦Is in cross memory mode
◦Is running with an enabled, unlocked, task mode (EUT) FRR

The branch entry (BRANCH parameter on GETMAIN or FREEMAIN) requires that your program hold certain locks. STORAGE does not have any locking requirement.


If your program runs in an environment where it can issue the FREEMAIN macro (as specified by the conditions listed above), you can use FREEMAIN to free storage that was originally obtained using STORAGE OBTAIN. You can also use STORAGE RELEASE to release storage that was originally obtained using GETMAIN.
Leena
Registered Member
Posts: 30
Joined: Fri Aug 09, 2013 10:17 pm

Re: Alternative for GETMAIN.

Post by Leena »

Thanks. Experience has its own ways to find answers.

Thank you so much for your help Robert.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “Assembler & PL/I.”