Alternative for GETMAIN.
Alternative for GETMAIN.
Hi,
I am looking for some alternate function for GETMAIN, is there any which can beused in plae of it? Please help.
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
- Posts: 843
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Alternative for GETMAIN.
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
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

-
- Global Moderator
- Posts: 490
- Joined: Sun Aug 25, 2013 7:24 pm
Re: Alternative for GETMAIN.
There is, which is to use Language Environment. But Why? is a very good question.
- Anuj Dhawan
- Founder
- Posts: 2824
- Joined: Sun Apr 21, 2013 7:40 pm
- Location: Mumbai, India
- Contact:
Re: Alternative for GETMAIN.
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.
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.
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
- Posts: 843
- Joined: Wed Sep 11, 2013 3:57 pm
Re: Alternative for GETMAIN.
telling that You use STORAGE OBTAIN/FREEMAIN is more trendy than telling that You are just a plain user of old plain GETMAIN/FREEMAIN
anyway see here about the differences
http://www-01.ibm.com/support/knowledge ... acros_.htm

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
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

Re: Alternative for GETMAIN.
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.
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.
- Robert Sample
- Global Moderator
- Posts: 1903
- Joined: Fri Jun 28, 2013 1:22 am
- Location: Dubuque Iowa
Re: Alternative for GETMAIN.
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.
Re: Alternative for GETMAIN.
Thanks. Experience has its own ways to find answers.
Thank you so much for your help Robert.
Thank you so much for your help Robert.
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