MFU_GET_FILE

Loads a file into memory, in preparation for running data-driven tests.

Use this routine when the main .csv file under test references field data in an external file. This technique is often used when the field-level data is complex or long, and is a way to circumvent the size limits placed on the .csv file under test.

Syntax:

call "MFU_GET_FILE" using by reference get-filename
                             by reference data-ptr
                             by reference data-size
end-call.

Parameters:

get-filename
pic x(n)
data-ptr
pointer
data-size
binary-long unsigned

On Entry:

get-filename
The name of the (space-terminated) file to be loaded.

On Exit:

data-ptr
The pointer to the data.
data-size
The length of the data loaded.

Comments:

If the status-code returned is anything other than 0, then it failed to allocate enough memory for the file. When the test has finished, your test clean-up should include a call to CBL_FREE_MEM, to release the memory allocated to data-ptr.

Example:

call MFU-GET-FILE using
                   by reference ws-filename
                   by reference ws-pointer
                   by reference ws-size
           end-call