Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

XCTL - Sending and receiving data of different size

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
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    Post subject: XCTL - Sending and receiving data of different size
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: 8120
Location: East Dubuque, Illinois, USA

PostPosted: Tue Dec 11, 2012 8:29 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Passing data from REXX to C programme... chong.zhou CLIST & REXX 2 Wed Jul 26, 2017 9:11 pm
No new posts Passing data from REXX to C programme... chong.zhou All Other Mainframe Topics 0 Wed Jul 26, 2017 4:55 pm
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 19 Thu Jul 13, 2017 2:11 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us