4 6 4 Exchange Lists

LANSA Open System Utilities

4.6.4 Exchange Lists

You will find a  thorough explanation of exchange lists with the EXCHANGE in the LANSA Technical Reference Guide.

When using exchange lists it is important to remember that extra calls to M@EXCHL are needed when directly calling a function.

The difference between using LANSA to RUN a function and directly calling the function, is that LANSA controls the transfer of the external (3GL) exchange list to the LANSA exchange list and vice versa. When a function is called directly these transfers must be done through additional calls to the M@EXCHL program.

One call to M@EXCHL is done just before the call to the 3GL program to map the external exchange list into the LANSA exchange list. Another is done right after the call to the 3GL program to map the LANSA exchange list back into the external exchange list.

The parameters required for these M@EXCHL calls are:

Parm No

Type

Min Len

Max Len

Comments

1

Alpha

3

3

'$AC' : Transfer onto exchange list

'$RC' : Receive from exchange list

2

Alpha

1

1024

DC@IDS - System Information

3

Alpha

1

2500

DC@EDS - Extra System Information

4

Alpha

1

5000

PR@IDS - Process Information

 

 

The correct sequence of calls when using exchange lists within a 3GL program to pass field values to a LANSA function is:

1.  CALL M@EXCHL 'CLR'

2.  CALL M@EXCHL 'PUT'

3.  CALL M@EXCHL '$AC'

4.  CALL Function (or Process)

5.  CALL M@EXCHL '$RC'

6.  CALL M@EXCHL 'GET' ...