IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

GETMAIN command


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Thamilselvi

New User


Joined: 22 Jun 2012
Posts: 57
Location: Chennai

PostPosted: Mon May 13, 2013 12:26 pm
Reply with quote

Hi All,

I have coded a COBOL CICS (online) program with Getmain command as below
EXEC CICS GETMAIN SET(MSG-PTR)
LENGTH(LENGTH OF MSG) END-EXEC.

and also using FREEMAIN command.
Last 2 days, our CICS region getting down/hang becoz of insufficient storage.

Doubts:
Want to know the best way of using GETMAIN command in my program, so that i won't get the insufficient storage. [Approximately, my program is running 5000 times daily]. Please advise me how to use GETMAIN effectively. I am using CICS 3.2 verison.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon May 13, 2013 1:25 pm
Reply with quote

There's very little information to go on here. How long is (LENGTH OF MSG) and should it read (LENGTH-OF-MSG) ? For what duration is the storage GETMAINed held before the FREEMAIN is issued? Why are you restricting to 'below-the-line' storage? (use FLENGTH to use 'above-the-line). What are DSA and EDSA limits?

Garry
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Mon May 13, 2013 2:45 pm
Reply with quote

1. Nobody on this forum can help you resolve a SHORT-ON-STORAGE situation (assuming that is what you meant by "insufficient storage"). Only someone working at your site (such as your CICS system programmer) can, ultimately, help resolve that.

2. Garry Carroll pointed out some of the information needed to resolve the issue. One key point: what has changed? If your CICS region was not going S-O-S before a couple of days ago, then something changed and that would be where to focus first..

3. Use of GETMAIN (and FREEMAIN) are not, by themselves, enough to cause S-O-S problems with a region. There are other factors, and the CICS region start parameters might be inadequate for your application.

4. One thing you need to be aware of is that there may well be NOTHING you can do to resolve the situation. If CICS region start parameters need to be changed, then your code may be functioning as it should but still cause S-O-S in the region until the start parameters are changed.

Garry Carroll: LENGTH OF <variable> is a valid and legitimate COBOL function; it is implicitly defined as full-word binary (PIC 9(9) COMP-5 in COBOL terms).
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Mon May 13, 2013 3:00 pm
Reply with quote

Quote:
Garry Carroll: LENGTH OF <variable> is a valid and legitimate COBOL function; it is implicitly defined as full-word binary (PIC 9(9) COMP-5 in COBOL terms).


I wasn't suggesting that LENGTH is not valid - just that it's restrictive.

from the friendly manual

"LENGTH(data-value)
specifies the number of bytes (unsigned halfword binary value) of storage required. LENGTH implies storage from below the 16MB line and has an upper limit of 65 520 bytes. If you want storage above the 16MB line or a larger area, use FLENGTH.
If LENGTH is equal to zero, LENGERR occurs. If it is greater than the amount of storage available, NOSTG occurs.

Note: FLENGTH, with or without BELOW, is the recommended option: the LENGTH option is supported for compatibility purposes for those programs written to run under earlier releases of CICS. "

Garry
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Mon May 13, 2013 6:28 pm
Reply with quote

What's the length of MSG? If it's not too large, just move MSG to WS and it will be allocated (Internal CICS GETMAIN) upon enclave creation, along with all the other defined WS and automatically freed when the enclave is terminated.

Does the GETMAIN'ed area have a special purpose which you haven't disclosed?

Is there some reason you need to GETMAIN below-the-line user-storage (LENGTH-Halfword), which is limited, as opposed to above-the-line user-storage (FLENGTH-Fullword), which is much more plentiful?

Do you need to save the GETMAIN address in a POINTER for subsequent use in a called sub-program?

What version/release of COBOL are you using?

Obtaining the address of WS (natively) was introduced with COBOL for OS/390 & VM V2.2 (about 12-13 years ago). Prior to this version/release, you could only obtain an address of a piece of storage which resided in LINKAGE (01 and 77 levels only) but there were creative ways around this restriction. icon_wink.gif

Please advise....
Back to top
View user's profile Send private message
singhju

New User


Joined: 01 Dec 2010
Posts: 25
Location: Gurgaon

PostPosted: Tue Jun 18, 2013 2:04 pm
Reply with quote

Quote:
"LENGTH(data-value)
specifies the number of bytes (unsigned halfword binary value) of storage required. LENGTH implies storage from below the 16MB line and has an upper limit of 65 520 bytes. If you want storage above the 16MB line or a larger area, use FLENGTH.
If LENGTH is equal to zero, LENGERR occurs. If it is greater than the amount of storage available, NOSTG occurs.


Hi Garry,
When I was going through the CICS Application programing Reference, I found the upper limit of LENGTH option as 32767 bytes while you indicate it as 65520 bytes. I am now in doubt which is more correct, is it what I read or the manual you read.
Back to top
View user's profile Send private message
Garry Carroll

Senior Member


Joined: 08 May 2006
Posts: 1193
Location: Dublin, Ireland

PostPosted: Tue Jun 18, 2013 2:36 pm
Reply with quote

singhju wrote:
Quote:
"LENGTH(data-value)
specifies the number of bytes (unsigned halfword binary value) of storage required. LENGTH implies storage from below the 16MB line and has an upper limit of 65 520 bytes. If you want storage above the 16MB line or a larger area, use FLENGTH.
If LENGTH is equal to zero, LENGERR occurs. If it is greater than the amount of storage available, NOSTG occurs.


Hi Garry,
When I was going through the CICS Application programing Reference, I found the upper limit of LENGTH option as 32767 bytes while you indicate it as 65520 bytes. I am now in doubt which is more correct, is it what I read or the manual you read.


I did a cut & paste of what I posted. I would go with what you read - my principal point was to suggest you use FLENGTH.

Garry.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2501
Location: Atlanta, Georgia, USA

PostPosted: Wed Jun 19, 2013 2:32 am
Reply with quote

A LENGTH value which exceeds 65536 must be defined as an unsigned-halfword. In fact, this is the recommended halfword definition.

For use in COBOL, when COMP-5 is not supported, the TRUNC(BIN) compiler option should be specified during compilation, to avoid high-order truncation on binary-fields.

HTH....
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts RACF - Rebuild SETROPTS command which... All Other Mainframe Topics 3
No new posts Routing command Address SDSF to other... TSO/ISPF 2
No new posts DTL - how to define key with stacked ... TSO/ISPF 3
No new posts LTJ command CA Products 4
No new posts Query on edit primary command CLIST & REXX 5
Search our Forums:

Back to Top