Skip navigation.

ATMI COBOL Function Reference

  Previous Next vertical dots separating previous/next from contents/index/pdf Contents View as PDF   Get Adobe Reader

 


FVSTOF(3cbl)

Name

FVSTOF() - copy from C structure to fielded buffer

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 "FVSTOF" USING FML-BUFFER DATA-REC FML-REC.

CALL "FVSTOF32" USING FML-BUFFER DATA-REC FML-REC.

Description

FVSTOF() transfers data from a C structure to a fielded buffer. FML-BUFFER is a record containing the fielded buffer. DATA-REC is the COBOL record. VIEWNAME IN FML-REC is the name of the view describing the COBOL record. FML-MODE IN FML-REC specifies the manner in which the transfer is made. FML-MODE has four possible values:

FUPDATE
FOJOIN
FJOIN
FCONCAT

The action of these modes are the same as that described in Fupdate, Fupdate32(3fml), Fojoin, Fojoin32(3fml), Fjoin, Fjoin32(3fml), and Fconcat, Fconcat32(3fml). One can even think of FVSTOF() as the same as these functions, except that where they specify a source buffer, FVSTOF() specifies a COBOL record. Bear in mind that FUPDATE does not move record elements that have NULL values.

FVSTOF32() is used for views defined with view32() typed buffers for larger views with more fields.

Return Values

Upon successful completion, FVSTOF32() sets FML-STATUS IN FML-REC to FOK.

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

Errors

Under the following conditions, FVSTOF() 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().

[FEINVAL]

"invalid argument to function"
One of the arguments to the function invoked was invalid.

[FBADACM]

"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.

[FBADVIEW]

"cannot find or get view"
The view description VIEWNAME was not found in the files specified by VIEWDIR or VIEWFILES.

See Also

Introduction to FML Functions, viewfile(5)

 

Skip navigation bar  Back to Top Previous Next