IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

XCTL - Sending and receiving data of different size


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
RockyS

New User


Joined: 16 Apr 2009
Posts: 10
Location: India

PostPosted: Tue Dec 11, 2012 7:14 am
Reply with quote

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!
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Dec 11, 2012 8:29 am
Reply with quote

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?
Back to top
View user's profile Send private message
RockyS

New User


Joined: 16 Apr 2009
Posts: 10
Location: India

PostPosted: Tue Dec 11, 2012 9:36 am
Reply with quote

Thanks Robert for guiding me to the manuals.

Quote:
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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
Search our Forums:

Back to Top