PURPOSE

FVFTOS, FVFTOS32 - copy from fielded buffer to a COBOL record

SYNOPSIS


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.

DESCRIPTION

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.

RETURN VALUES

Upon successful completion, FVFTOS sets FML-STATUS in FML-REC to FOK.

On error, FML-STATUS is set to a non-zero value.

ERRORS

Under the following conditions, FVFTOS fails and sets FML-STATUS to:

[FALIGNERR]
"fielded buffer not aligned"
The buffer does not begin on the proper boundary.
 
[FNOTFLD]
"buffer not fielded"
The buffer is not a fielded buffer or has not been initialized by FINIT().
 
[FBADACM]
"ACM contains negative value"
An Associated Count Member should not be a negative value while transferring data from a structure to a fielded buffer.
 
[FBADVIEW]
"cannot find or get view"
The view description VIEWNAME was not found in the files specified by VIEWDIR.

SEE ALSO

Fintro(3fml),
viewfile(5),