4 6 1 Data Structures

LANSA Open System Utilities

4.6.1 Data Structures

For example, a function that receives a data structure would be called with a parameter list similar to this:

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              PSLMST

In Control Language

CALL PGM(FUNNAME) +

PARM(&DC@IDS &DC@EDS &PR@IDS &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)

PSLMST

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

 

 

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

Note 2: 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'.

Note 3: If this is a "wrapper" RDML function that is itself calling another function using PASS_DS, then it is necessary to refer to all of the fields in the data structure, otherwise their values will not be passed on. A way of doing this would be via the GROUP_BY RDML command.