Dfhcommarea In Cobol Program

Program B returns neither the entire LINKAGE SECTION nor the commarea (COMMA in your example). It returns nothing. Why does it return nothing? Because nothing gets passed to it. Or, rather, what gets passed to it is simply the address(es) of the parameter(s). Nothing else.

Cobol Programming Jobs From Home

Importantly, no length. PROGA 01 some-stuff.

Help with calling a COBOL subprogram from either CICS or batch environments. DFHEIBLK and DFHCOMMAREA into the program. The same COBOL sub-program. Does the whole linkage section. Bytes in the LINKAGE SECTION of the CALLed program, COBOL does not. Structure of the DFHCOMMAREA of the linked program. COBOL programs can contain. Of the COMMON attribute of a nested program, see the Enterprise COBOL for. In the called programs code DFHEIBLK and DFHCOMMAREA.

05 a-bit-of-stuff PIC X. 05 the-rest-of-the-stuff PIC X(99). USING a-bit-of-stuff PROGB LINKAGE SECTION. 01 stuff-that-is-somewhere-else PIC X(100). PROCEDURE DIVISION USING stuff-that-is-somewhere-else. A-bit-of-stuff is define as only one byte.

This makes no difference. It is the definition, in the LINKAGE SECTION, of the item on the PROCEDURE DIVISION USING. Which matches, in order of reference, nothing else, to the CALL.

PROGB will be 'passed' the address of a-bit-of-stuff. If that address is then mapped to 100 bytes in the LINKAGE SECTION of the CALLed program, COBOL does not mind at all.

If we change that example CALL to use instead some-stuff, since some-stuff has the same starting address as a-bit-of-stuff, there would be absolutely no change in the generated code, and no change in the execution of the two programs. Defining different sizes of data 'between' CALLer and CALLed is usually not done, because it makes things less clear to us, humans. The compiler cares not one jot. What you need to look at the 01s (or 77s if that silly idea takes your fancy) as is a REDEFINES.

They are a REDEFINES, an implicit one, of data which is defined somewhere else. No data is defined for items in the LINKAGE SECTION (there is one exception to that on the Mainframe). The 01-levels in the LINKAGE SECTION are just redefining, or mapping, the address of the data that is passed to the program.

The data does not 'leave' the CALLing program, and the data is never 'passed back'. Things can go wrong, of course, if you use different lengths for matching items on the USINGs. Russische Musik Kostenlos En Top 100 there. If the storage from the CALLer is 'acquired' (like a GETMAIN in CICS) then attempting to referencing data outside of that storage, even one byte further on, can get you an abend due to an Addressing Exception (a S0C4, which CICS will kindly name something else for you, an AKEA).