ATMI COBOL Function Reference
FVFTOS()
, FVFTOS32()
- copy from fielded buffer to COBOL structure
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.
The FVFTOS()
function 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-REC
is 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, FVFTOS32()
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:
"ACM contains negative value"
An Associated Count Member should not be a negative value while transferring data from a COBOL record to a fielded buffer.