Can an invoked program be made to receive less data than that being passed by the invoking program (using XCTL) without an abend?
I have a scenario where program PRG1 calls PRG2, PRG3, PRG4, PRG5. . . PRG49.
01 DFHCOMMAREA PIC(1000).
MOVE PRG2 TO TRANSFER-TO-PGM
ELSE IF X=3
MOVE PRG3 TO TRANSFER-TO-PGM
ELSE IF X=49
MOVE PRG49 TO TRANSFER-TO-PGM
XCTL PROGRAM (TRANSFER-TO-PGM)
where X and TRANSFER-TO-PGM are working storage variables and length of COPYOLD is 1000 bytes.
Called programs PRG2, PRG3. . . PRG49 receive as below
Now I have a requirement to introduce a new copybook (COPYNEW of length 20) which will be used ONLY in PRG2 and not in PRG3, PRG4. . . PRG49.
[PRG3, PRG4 . . . PRG49 remain as before]
will PRG3, PRG4 . . . PRG49 abend when invoked as I am trying to pass 1020 from PRG1 but they can receive only 1000 bytes? I don't need the last 20 bytes and don't care about any truncation as long as get first 1000 bytes correctly.
Not inclined towards adding COPYNEW to the LINKAGE SECTION of PRG3, PRG4, PRG5. . .PRG49 as it anyway be redundant and will also involve overhead (code change/compilation).
I would have loved to try out myself but currently in design phase and don't have a development region. Any suggestions are much appreciated.
Joined: 06 Jun 2008 Posts: 8280 Location: Dubuque, Iowa, USA
What is EIBCALEN used for?
Do programs PRG3 through PRG49 check the length of DFHCOMMAREA?
I think you have a fundamental misunderstanidng of DFHCOMMAREA. A program does NOT "receive" DFHCOMMAREA. The calling program passes the variable; whether or not the called program uses any or all of the bytes of DFHCOMMAREA depend entirely upon the program -- there is nothing to "receive". Terminology is critical in IT, where similar terms may mean very different things. And the term "receive" already is used in CICS programs, and that meaning has nothing to do with DHFCOMMAREA. Perhaps you should click on the IBM Manuals link at the top of this page, find the CICS Language Reference manual, and read the section on EXEC CICS RECEIVE before going any further?
The receiving data area need not be of the same length as the original communication area; if access is required only to the first part of the data, the new data area can be shorter. However, it must not be longer than the length of the communication area being passed, because if it is, your transaction may inadvertently read data outside the area that has been passed.