Page 1 of 1

GETMAIN COMMAND

PostPosted: Fri Mar 23, 2012 5:39 pm
by sinmani
GETMAIN command?? Will program not work if we do not give GETMAIN?
GETMAIN command allocates memory for the program but why do we need to provide it explicitly??

Re: GETMAIN COMMAND

PostPosted: Fri Mar 23, 2012 5:50 pm
by BillyBoyo
Depends. If your program needs to acquire extra memory, it'll need the GETMAIN. If it doesn't need it, it doesn't need it. Find a senior at your site, they will be able to sit you down and explain it better than we can from scratch. Plus, they're paid for that :-)

Re: GETMAIN COMMAND

PostPosted: Fri Mar 23, 2012 6:15 pm
by sinmani
what I have learnt is that if we do not give GETMAIN command and extra memory is needed.
The program tries to get that extra memory. If it doesn't gets it will try again later.
But if we give GETMAIN command and the extra memory is not available then we get an error NOSTG.
Our program will abend if we do not HANDLE this abend.

So I am wondering why do we bother to give GETMAIN when it works bettter without it?? :?:

Re: GETMAIN COMMAND

PostPosted: Fri Mar 23, 2012 6:45 pm
by Robert Sample
You have a VSAM file that contains a table your CICS programs need. You could use GETMAIN to allocate memory as shared, read the table in memory, and allow multiple tasks to use the table without incurring the overhead of reading the table from the VSAM file so many times.