XCTL - Sending and receiving data of different size

Go down

XCTL - Sending and receiving data of different size

Post  kasthuri on Sun Jan 27, 2013 5:31 pm

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.

Program PRG1:
Code:
WORKING-STORAGE SECTION.
01 COPYOLD
COPY COPYOLD.

LINKAGE SECTION.
01 DFHCOMMAREA PIC(1000).

PROCEDURE DIVISION

IF X=2
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
END-IF
.
.
.
EXEC CICS
XCTL PROGRAM (TRANSFER-TO-PGM)
COMMAREA (COPYOLD)
END-EXEC.

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
Code:
LINKAGE SECTION.
01 DFHCOMMAREA.
COPY COPYOLD.


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.

If I modify PRG1 to:
Code:
WORKING-STORAGE SECTION.
01 COPYOLD
COPY COPYOLD
COPY COPYNEW

LINKAGE SECTION.
01 DFHCOMMAREA PIC(1020).

and PRG2 to
Code:
LINKAGE SECTION.
01 DFHCOMMAREA.
COPY COPYOLD.
COPY COPYNEW

[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.
Thanks!

kasthuri

Posts : 212
Join date : 2013-01-27

View user profile

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum