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