Under z/OS® batch

JCL procedure EDCICONV invokes the iconv utility to copy the input data set to the output data set and convert the characters from the input code page to the output code page.

The EDCICONV procedure has the following parameters:
INFILE
The data set name for the input data set
OUTFILE
The data set name for the output data set
FROMC
The name of the code set in which the input data is encoded
TOC
The name of the code set to which the output data is to be converted
Example: See the following example.
//ICONV    EXEC PROC=EDCICONV,
//         INFILE='FRED.INFILE',
//         OUTFILE='FRED.OUTFILE',
//         FROMC='IBM-037',
//         TOC='IBM-1047'

Records from the input data set are processed by the iconv utility sequentially, one record at a time. If DBCS or multibyte character codes span a record boundary, the iconv utility will not recognize the partial sequence as a valid character and will fail. Therefore, input records must terminate with a complete character sequence. Be sure that the record length of the input data set is large enough to contain the longest input record.

The output data set must be preallocated. If the data set does not exist, iconv will fail. An output data set with a fixed record format may only be used if all the records created by the iconv utility will have the same record length as the output data set. No padding or truncation is performed. If the output data set has variable length records, the record length must be large enough for the longest record created. Because of these restrictions, when converting to or from a DBCS, the output data set must have variable length records. Otherwise, the iconv utility will fail.

For more information on the iconv utility, refer to z/OS XL C/C++ Programming Guide.