Code page conversion of a file in a batch job

In this post a sample of how to perform a code page conversion of z/OS Unix files in a batch job. The different iconv utility lines show invocation for different code pages.

//*                                      
//STEP1    EXEC PGM=BPXBATCH   
//STDERR   DD SYSOUT=*  
//STDPARM  DD   *              
 SH  iconv -f UTF-8 -t IBM-1140 < inutf8 > outebc 
/*                                                     
//               
 SH  iconv -f IBM-1140 -t IBM-1252 < inebc > out1252 
//  
 SH  iconv -f IBM-1252 -t IBM-1140 < in1252 > out1140 
//     
 SH  iconv -f IBM-1140 -t UTF-8 < inebc > oututf8  
 //                       

Leave a Reply