MBCS Conversion During Microsoft Windows to z/OS Copy

The following is an example for copying a Microsoft Windows file to a z/OS system and converting the 932 code set on Microsoft Windows to the IBM®-943 code set on the z/OS system.

FROMNT  COPY  TO    (PNODE DISP=(,CATLG)                               -
                     UNIT=SYSDA                                        -
                     VOL=SER=USER01                                    -
                     SPACE=(TRK,(1,1))                                 -
                     DCB=(DSORG=PS,RECFM=U,BLKSIZE=24000)              -
                     DSN=TEST2.MBCS.LMORL1.SJIS001                     -
                     SYSOPTS="CODEPAGE=(UTF-8,IBM-943)" )              -
              FROM  (SNODE DISP=SHR                                    -
                     file='I:\Lcm\CD\TestData\Source\SjisCodepage.txt' -
                     sysopts="codepage(932,65001) datatype=binary"  )

As specified in the FROM clause, the 932 code set data in the SjisCodepage.txt file is converted to the 65001 code set (the UTF-8 equivalent on Microsoft Windows) on the Microsoft Windows node. The 65001 encoded data is then transferred to the z/OS node, which converts the data to the IBM-943 code set and writes a z/OS sequential file.

Note that the z/OS output file is defined as having an undefined record format (RECFM=U). When an MBCS conversion is done for a file that is created on a z/OS receiving node, the RECFM for the file must be specified as either V (Variable), VB (Variable Block), or U. The results of an MBCS conversion can result in a change to the physical length of the data, and the amount of the change can vary, depending on the data. RECFM=F (Fixed) or FB (Fixed Block) cannot be used, because the final data length is not fixed.