FVFTOS, FVFTOS32 - copy from fielded buffer to a COBOL record
01 DATA-REC. COPY User data. 01 FML-BUFFER. 05 FML-ALIGN PIC S9(9) USAGE IS COMP. 05 FML-DATA PIC X(applen). 01 FML-REC COPY FMLINFO. CALL "FVFTOS" USING FML-BUFFER DATA-REC FML-REC. CALL "FVFTOS32" USING FML-BUFFER DATA-REC FML-REC.
FVFTOS transfers data from a fielded buffer to a COBOL record. FML-BUFFER is a pointer to a fielded buffer initialized with FINIT. DATA-REC is a pointer to a C structure. VIEWNAME in FML-RECis the name of the view describing the COBOL record.
Fields are copied from the fielded buffer into the structure based on the element descriptions in VIEWNAME. If a field in the fielded buffer has no corresponding element in the COBOL record, it is ignored. If an element specified in the COBOL record has no corresponding field in the fielded buffer, a null value is copied into the element. The null value used is definable for each element in the view description.
To store multiple occurrences in the COBOL record, the record element should be defined with OCCURS. If the buffer has fewer occurrences of the field than there are occurrences of the element, the extra element slots are assigned null values. On the other hand, if the buffer has more occurrences of the field than there are occurrences of the element, the surplus occurrences are ignored.
FVFTOS32 is used for views defined with view32 typed buffers for larger views with more fields.
Upon successful completion, FVFTOS sets FML-STATUS in FML-REC to FOK.
On error, FML-STATUS is set to a non-zero value.
Under the following conditions, FVFTOS fails and sets FML-STATUS to: