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 command

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: GETMAIN command
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon May 13, 2013 1:25 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Mon May 13, 2013 2:45 pm    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Mon May 13, 2013 3:00 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon May 13, 2013 6:28 pm    Post subject: Reply to: GETMAIN command
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    Post subject:
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

Active Member


Joined: 08 May 2006
Posts: 990
Location: Dublin, Ireland / Edinburgh, Scotland

PostPosted: Tue Jun 18, 2013 2:36 pm    Post subject:
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: 2502
Location: Atlanta, Georgia, USA

PostPosted: Wed Jun 19, 2013 2:32 am    Post subject: Reply to: GETMAIN command
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    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 What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts SDSF Command Avtrix CLIST & REXX 4 Fri Sep 30, 2016 11:13 am
No new posts How to find a CICS resource used in C... Arunkumar Chandrasekaran CICS 8 Thu Sep 29, 2016 1:45 pm
No new posts COMPARE command sivatechdrive TSO/ISPF 7 Fri Sep 16, 2016 4:31 pm
No new posts I am unable to use SWAPBAR ON command... mrsidhu12 TSO/ISPF 3 Thu Sep 01, 2016 1:10 pm


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