Sample JCL
to do codepage conversion between z/OS datasets, and also z/OS Unix files.
//ICONV PROC
INFILE=, < INPUT DATA SET
//
REGSIZ='6M', <
ICONV REGION SIZE
//
OUTFILE=, <
OUTPUT DATA SET
//
FROMC=, <
INPUT CODE SET NAME
// TOC= < OUTPUT CODE SET
NAME
//*
//ICONV EXEC
PGM=EDCICONV,REGION=®SIZ,
//
PARM=('FROMCODE(&FROMC),TOCODE(&TOC)')
//SYSUT1 DD
DSNAME=&INFILE,DISP=SHR
//SYSUT2 DD
PATH=&OUTFILE,
//
PATHOPTS=(OCREAT,OWRONLY),PATHMODE=(SIRUSR,SIWUSR)
//SYSPRINT DD
SYSOUT=*
//STDOUT DD SYSOUT=*
//STDERR DD SYSOUT=*
//SYSIN DD
DUMMY
// PEND
//S1 EXEC
ICONV,
//
INFILE='YOUR.INPUT.DATASET',
//
OUTFILE='''/your/output/iconvtstd''',
//
FROMC='IBM-037',
//
TOC='01200'
//*-----------------------------------------------------------------
//* Convert UNICODE to EBCDIC
//*-----------------------------------------------------------------
//ICONV EXEC
PGM=EDCICONV,REGION=0M,
//
PARM=('FROMCODE(01200),TOCODE(IBM-037)')
//SYSUT1 DD
DSNAME=GB41.TEST.UNICODE,DISP=SHR
//SYSUT2 DD
DSNAME=GB41.TEST.EBCDIC,DISP=(,CATLG,CATLG),
//
AVGREC=M,SPACE=(15,(15,15),RLSE),
//
RECFM=FB,LRECL=15
//SYSPRINT DD
SYSOUT=*
//STDOUT DD
SYSOUT=*
//STDERR DD
SYSOUT=*
//SYSIN DD
DUMMY