Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

COBOL Programming :: RE: How to move a long alphanumeric data items to another.

$
0
0
Author: Robert Sample
Posted: Tue Dec 06, 2016 1:37 am (GMT 5.5)

Quote:
Is there any thing false here?
Looking at your post again, definitely there's falseness! For starters, you did not say if this program is being invoked by a terminal transaction code, as an interval started background transaction, from a CICS LINK or XCTL, or as a COBOL CALL statement. The reason the type of invocation makes a difference is that variables defined in the LINKAGE SECTION do not have memory allocated in the program -- the memory must come from some other source. For CICS programs, the usual source is the calling program's WORKING-STORAGE via the DFHCOMMAREA passed by the EXEC CICS LINK or XCTL (or by the memory passed by the USING on the CALL COBOL verb) but the memory could also be obtained via EXEC CICS GETMAIN.

If the source is from the calling program, what size was the passed DFHCOMMAREA? If the DFHCOMMAREA passed by the calling program is at least 5000 bytes but less than 8000 bytes, then the behavior you described would occur -- a 5000-byte MOVE would work fine (since the LINKAGE SECTION data has at least 5000 bytes) but an 8000-byte MOVE would fail (since the LINKAGE SECTION variable is less than 8000 bytes long). As Marso mentioned, CICS has specific checks to ensure programs do not attempt to use more memory than they have allocated.

Note that COBOL subprograms have PROCEDURE DIVISION USING <linkage variable(s)> to indicate that the LINKAGE SECTION variables are defined from the calling program -- CICS inserts the USING if you don't code for it.
_________________
TANSTAAFL

The first rule of code reuse is that the code needs to be worth re-using.

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth


Viewing all articles
Browse latest Browse all 9405

Trending Articles