Using Dialog System 'Callout'

If you wish to use the callout facility of Dialog System with the Client/Server Binding, you have to make a small change to your user client program, and create programs to service the callout request at either end of the connection. You need to add two lines and a directive to your user client program, as follows-:

At the start of the program:

$set ans85 linkcount(128)

In Working-Storage:

 01  lnk-param-block-addr         POINTER EXTERNAL.

In the Procedure Division:

     SET lnk-param-block-addr 
              TO ADDRESS OF lnk-param-block

The reason for this is so that the program called by dialog to handle the callout request has access to the same parameter entries as your user client program. This is achieved by use of an external data pointer. The callout program needs to have code similar to that in the example below:

$set ans85
 WORKING-STORAGE SECTION.

 01  lnk-param-block-addr         POINTER EXTERNAL.

 LINKAGE SECTION.

 COPY "mfclisrv.cpy".

 01  user-data-block              PIC X(30).

 PROCEDURE DIVISION.
 Controlling SECTION.
     SET ADDRESS OF lnk-param-block TO lnk-param-block-addr
     SET ADDRESS OF user-data-block TO lnk-ublock-ptr
     SET ds-callout TO TRUE
     MOVE "callosrv" TO user-data-block
     CALL lnk-client USING lnk-param-block
     EXIT PROGRAM.

The name of the program which will receive the callout request on the server is setup in the user-data-block. If the name of this program can only be determined from data in any of the control blocks used by Dialog System, you will have to make these accessible using coding similar to that in the following program-:

$set ans85 linkcount(128)
 WORKING-STORAGE SECTION.

 01  lnk-param-block-addr         POINTER EXTERNAL.

 LINKAGE SECTION.

 COPY "mfclisrv.cpy".

 01  user-data-block              PIC X(30).

     COPY "DS-CNTRL.MF".
     COPY "CUSTOMER.CPB".

 PROCEDURE DIVISION USING ds-control-block customer-data-block.
 Controlling SECTION.
     SET ADDRESS OF lnk-param-block TO lnk-param-block-addr
     SET ADDRESS OF user-data-block TO lnk-ublock-ptr
     SET ds-callout TO TRUE
     EVALUATE cust-callout-flg
      WHEN 1
         MOVE "callprog1" TO user-data-block
      WHEN 2
         MOVE "callprog2" TO user-data-block
     END-EVALUATE
     CALL lnk-client USING lnk-param-block
     EXIT PROGRAM.

The callout program on the server side will look something like this-:

$set ans85

 LINKAGE SECTION.

     COPY "DS-CNTRL.MF".
     COPY "CUSTOMER.CPB".

 PROCEDURE DIVISION USING ds-control-block customer-data-block.
 Controlling SECTION.
       ............ Code to
           ........... process callout
               ............ request....
           EXIT PROGRAM.