HELP: Default format for array with column names and data pointers [PCLNDLNCOLDAT] TYPE: NUMBER SYNTAX: ARYFMT=PCLNDLNCOLDAT
The array format allows to write the column and data length and a pointer to the column name and to the data value for each defined entry (where no null indication was set) instead of the value itself to your data stream/structure. This is useful for large XML definitions where a lot of the columns are not used to reduce memory utilization for this variable length data. The pointer is in native/usable format (incl. bit width) and valid up to the next read operation. When writing, the data the pointer points to is copied and the data needs to only be valid for the duration of this operation.
On a 32 bit system, the pointer requires 4 bytes. On a 64 bit system, the pointer requires 8 bytes. The length is always a 32 bit unsigned integer in local endianness.
The example below shows a type definition in C for the currect supported structure.
typedef struct PCLNDLNCOLDAT { U32 uiColLen; U32 uiDatLen; const C08* pcColNam; const U08* pcColDat; }TsPCLNDLNCOLDAT;
When writing to memory, the space for the data is allocated and managed by FLAM. When reading from memory, the application must provide the pointer and is responsible for it. The structure above is aligned on 32 bit (in total 16 Byte in size) and 64 bit (in total 24 Byte in size) and is not critical and compatible on all platforms with all programming languages. A additional alignment must not be defined.
For each set value, such a filled structure is returned or expected as an array. When reading, FLAM correlates via this array to determine the contents for the columns. When writing to memory, the application must go through the column names to know which values were set. The record length is therefore always a multiple of the structure size of 16 or 24 bytes, depending on whether you are on a 32 or 64 bit machine.
PCLNDLNCOLDAT - 32 bit length field (integer, system endian) for column name, 32 bit length filed (integer, system endian) for data length, pointer to the column name, pointer to the data; no padding but aligned (packed, 16/24 bytes on 32/64 bit systems)