C
This option requests the generation of a structure member called the associated count member (ACM), in addition to the structure member described in the member description.
When data is being transferred from a fielded buffer to a structure, each ACM in the structure is set to the number of occurrences transferred to the associated structure member.
A value of 0 in an ACM indicates that no fields were transferred to the associated structure member
A positive value indicates the number of fields actually transferred to the structure member array.
A negative value indicates that there were more fields in the buffer than could be transferred to the structure member array. (The absolute value of the ACM equals the number of fields not transferred to the structure).
During a transfer of data from a structure member array to a fielded buffer, the ACM is used to indicate the number of array elements that should be transferred. For example, if the ACM of a member is set to N, then the first N non-null fields are transferred to the fielded buffer. If N is greater than the dimension of the array, it then defaults to the dimension of the array. In either event, after the transfer takes place, the ACM is set to the actual number of array members transferred to the fielded buffer.
The type of an ACM in the C header file is declared to be short for FML and long for FML32, and its name is generated as C_cname, where cname is the cname entry for which the ACM is declared. For example, an ACM for a member named parts is declared as follows:
short C_parts;
For a COBOL COPY file, the name is generated as C-cname and the type is declared as follows:
For FML: PIC S9(4) USAGE COMP-5
For FML32: PIC S9(9) USAGE COMP-5
Note: It is possible for the generated ACM name to conflict with structure members with names that begin with a C_ prefix. Such conflicts are reported by the view compiler, and are considered fatal errors by the compiler. for example, the name C_parts for a structure member conflicts with the name of an ACM generated for the member parts.
L
This option is used only for member descriptions of type carray or string to indicate the number of bytes transferred for these possibly variable length fields. If a string or carray field is always used as a fixed length data item, then this option provides no benefit.
The L option generates an associated length member (ALM) for a structure member of type carray or string. When transferring data from a fielded buffer to a structure, the ALM is set to the length of the corresponding transferred fields. If the length of a field in the fielded buffer exceeds the space allocated in the mapped structure member, only the allocated number of bytes is transferred. The corresponding ALM is set to the size of the fielded buffer item. Therefore, if the ALM is greater than the dimension of the structure member array, the fielded buffer information is truncated on transfer.
When data is being transferred from a structure member to a field in a fielded buffer, the ALM is used to indicate the number of bytes to transfer to the fielded buffer, if it is a carray type field. For strings, the ALM is ignored on transfer, but is set afterwards to the number of bytes transferred. Note that because carray fields may be of zero length, an ALM of 0 indicates that a zero-length field should be transferred to the fielded buffer, unless the value in the associated structure member is the null value.
An ALM is defined in the C header file as an unsigned short for FML and an unsigned long for FML32, and has a generated name of L_cname, where cname is the name of the structure for which the ALM is declared.
If the number of occurrences of the member for which the ALM is declared is 1 (or defaults to 1), then the ALM is declared as:
unsigned short L_cname;
whereas if the number of occurrences is greater than 1, say N, the ALM is declared as:
unsigned short L_cname[N];
and is referred to as an ALM Array. In this case, each element in the ALM array refers to a corresponding occurrence of the structure member (or field). For the COBOL COPY file, the type is declared to be PIC 9(4) USAGE COMP-5 for FML and PIC 9(9) USAGE COMP-5 for FML32, and its name is generated as L-cname. The COBOL OCCURS clause is used to define multiple occurrences if the member occurs multiple times.
Note: It is possible for the generated ALM name to conflict with structure members with names that begin with an L_ prefix. Such conflicts are reported by the view compiler, and are considered fatal errors by the compiler. For example, the name L_parts for a structure member conflicts with the name of an ALM generated for the member parts.
P
This option can be used to affect what VIEWS interprets as a null value for string and carray type structure members. If this option is not used, a structure member is null if its value is equal to the user-specified null value (without considering any trailing null characters).
If this option is set, however, a member is null if its value is equal to the user-specified null value with the last character propagated to full length (without considering any trailing null character).
A member whose value is null is not transferred to the destination buffer when data is transferred from the C structure or COBOL record to the fielded buffer. For example, a structure member TEST is of type carray[25] and a user-specified null value "abcde" is established for it. If the P option is not set, TEST is considered null if the first five characters are a, b, c, d, and e, respectively. If the P option is set, TEST is null if the first four characters are a, b, c, and d, respectively, and the rest of the carray contains the character "e" (that is, 21 e's).
This option is ignored if the -n command-line option is specified.