4 6 3 Data Structures and Working Lists

LANSA Open System Utilities

4.6.3 Data Structures and Working Lists

A function that receives both working lists and data structures would be called with a parameter list similar to this:

Working list received:

PSLSKL

 

Working list elements:

SKILCODE

A(4)

SKILDESC

A(20)

COMMENT

A(40)

Data structure received:

PSLMST

 

Data structure elements:

EMPNO

A(5)

SURNAME

A(20)

GIVENAME

A(20)

BIRTHDT

A(6)

SALARY

S(9,2)

 

 

In RPG/400

      CALL   FUNNAME

      PARM              DC@IDS

      PARM              DC@EDS

      PARM              PR@IDS

      PARM              PSLSKL

      PARM              PSLNUM

      PARM              PSLPOS

      PARM              PSLMST

In Control Language

CALL PGM(PRONAME) +

PARM(&DC@IDS &DC@EDS &PR@IDS &PSLSKL +

&PSLNUM &PSLPOS &PSLMST)

where:

FUNNAME

Is the function object name

DC@IDS

System information  A(1024)

DC@EDS

Extra System information  A(2500)

PR@IDS

Process Information  A(5000)

PSLSKL

Passed working list (Note 1)  n * A(64)

PSLNUM

Number of entries in list (Note 1)  P(7,0)

PSLPOS

Position in list (Note 1)  P(7,0)

PSLMST

Passed data structure (Note 2)  A(Note 3)

 

 

Note 1: The 'Passed working list' parameters are repeated for each passed working list.

The 'n' occurrences is the number of entries in the working list that have been passed.

Note 2: The 'Passed data structure' parameter is repeated for each of the Passed data structures.

Note 3: The size of the 'Passed data structure' parameter in this scenario could be 60 or 64 bytes. That is, 60 bytes if the PSLMST data structure is a file defined externally to LANSA (OTHER) or 64 bytes if it is a LANSA defined file. The extra 4 bytes in the LANSA file is the @@UPID field used by all files created using LANSA. Each of the fields in the data structure (file) contribute to the aggregate length of the 'Passed data structure'.

Refer to 4.5.2 Source Members Shipped with LANSA for further information about the standard parameters.