Joe, thanks for the post.

When a caller calls COB#SYNC it indeed passes 2 parms, but the first one is 
just a name of the program to attach, so it's internal to COB#SYNC logic.

The second parm is the one actually passed to the subtask on the ATTACH, so it 
does match the PROCEDURE USING on the callee.  As was explained in a prior post 
such parm has to conform to the EXEC PARM='...' convention.

-Victor-  

----------------------------------------------------------------------------------------------------------------------------
Hello:  When a COBOL CALL or ENTRY is compiled, each item in the USING is used 
to create code to process a parameter list of full words equal in number to the 
number of items in that USING clause.  So the CALL parameter list will have two 
full words.  The ENTRY code will only process one full word.  

So, the CALL to COB#SYNC builds two fullwords of addresses, but the PROCEDURE 
DIVISION USING is only going to load one BLL cell.  The BLL cell for item 
TPTAPI-COMMAREA will be loaded with the address of the caller's item WS-TPTAPI. 
 The second item WS-TPTAPI-COMMAREA is not addressible by the subroutine 
(unless the second item is contiguous in storage to WS-TPTAPI and the 
TPTAPI-COMMAREA item describes both areas, a somewhat unorthodox way of passing 
parameters).

I would have coded two items in the subroutines ENTRY USING clause. 

CALL-TPTAPI.                                       
                                                     
    DISPLAY WS-TPTAPI-COMMAREA                       
    CALL "COB#SYNC"      USING WS-TPTAPI             
                               WS-TPTAPI-COMMAREA.   
  -  -  -  -  -  -  -  -  -  -  -  -  -  2 Line(s) no
    DISPLAY WS-TPTAPI-COMMAREA.                      


The subroutine's PROCEDURE USING:

PROCEDURE DIVISION USING TPTAPI-COMMAREA. 

regards, Joe D'Alessandro

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to