The procedure for issuing a CSV is shown in the following sample code that uses CONVERT.
#include <wincsv.h>
.
.
struct convert conv_block;
The VCB structures are declared in the WINCSV.H file; one of these structures is named CONVERT.
memset( conv_block, '\0', sizeof( conv_block ) );
This procedure is not required. However, it helps in debugging and reading the contents of memory. It also eliminates the possibility that future versions of a verb are sensitive to fields that are ignored in the current version.
conv_block.opcode = SV_CONVERT;
conv_block.direction = SV_ASCII_TO_EBCDIC;
conv_block.char_set = SV_AE;
conv_block.len = sizeof(tpstart_name);
conv_block.source = (LPBYTE) tpstart_name;
conv_block.target = (LPBYTE) tpstart.tp_name;
The values SV_CONVERT, SV_ASCII_TO_EBCDIC, and SV_AE are symbolic constants representing integers. These constants are defined in the WINCSV.H file.
The character array TPSTART_NAME contains an ASCII string to be converted to EBCDIC and placed in the character array TPSTART.TP_NAME.
ACSSVC((LONG) &conv_block);
You can also use the following statement:
ACSSVC_C((LONG) &conv_block);
if( conv_block.primary_rc == SV_OK ) {
/* other statements */
.
.
.