ca.portal.admin

question about ""get storage""

Discussion created by ca.portal.admin on May 5, 2010
Latest reply on May 7, 2010 by ca.portal.admin
We have a DC-COBOL program PROGRAMA with a storage area defined in the linkage section as follows:

01 LK-REPLY-MESSAGE.
05 FILLER PIC X(1000).
05 LK-REPLY-MESSAGE-END PIC X(01).


And the corresponding ""get storage"" command coded as follows:

GET STORAGE
FOR LK-REPLY-MESSAGE TO LK-REPLY-MESSAGE-END
KEEP LONG USER
STGID 'RP01'.

The storage is allocated by PROGRAMB, which is called prior to doing the ""get storage"" in PROGRAMA. When PROGRAMB misbehaves and allocates a piece of storage larger than 1000 bytes, it appears that PROGRAMA's ""get storage"" command reads in the entire too-large piece of storage, tromping over its own memory. Various abends result, depending on the size of the storage, usually D003's.

I thought that coding the LK-REPLY-MESSAGE-END field would prevent this from happening, but it appears not.
Is there any way that we can ensure that only 1000 byes is referenced in PROGRAMA's linkage section, no matter how large the allocated storage actually is?

Kay Rozeboom
State of Iowa
Information Technology Enterprise
Department of Administrative Services
Telephone: 515.281.6139 Fax: 515.281.6137
Email: Kay.Rozeboom@Iowa.Gov
"
IDMS 3rd-party providers forum
IDMSVENDOR-L@LISTSERV.IUASSN.COM
SMTP
IDMSVENDOR-L@LISTSERV.IUASSN.COM
IDMSVENDOR-L@LISTSERV.IUASSN.COM
SMTP








Normal

Normal
"Re: question about ""get storage"""
"Why not use the LENGTH parameter instead (from the manual):

LENGTH
Specifies the length of the storage location (COBOL 85 only).
storage-data-length
The symbolic name of a user-defined field that contains the length of the storage location.

I assume that you are using at least COBOL II - right?

Dan Miley
Lockheed Martin

Outcomes