To Customize Character Set Conversion

Note: When creating a customized character set conversion, the resulting program will not be thread safe unless it contains a Local-Storage Section declaration immediately after the Working-Storage Section.

The codeset module must be compiled using DIALECT"MF", and the NOCANCEL directive; otherwise, you may experience RTS114 abends when the module is first called when running through an enterprise server region.

The sample program CSnnnn.cbl, which is supplied in the src\codeset sub-directory of your installation directory, contains the necessary sections, declarations and directives.

  1. Start a Visual COBOL command prompt. If you need instructions, see To start a Visual COBOL command prompt.
  2. Create a new directory to hold temporary files and make it the current directory. For example:
    md mylang
    cd mylang
  3. At the prompt, enter:
    set mfcodeset=nnnn

    where nnnn refers to an MFCODESET value (listed in the Supported Country Codes topic) whose character set conversion tables are most similar to the customized versions you want to create.

  4. Enter:
    codecomp /p mapfile.a2e mapfile.e2a

    The files mapfile.a2e and mapfile.e2a are created in the current directory.

  5. Edit the conversion tables in the mapfiles to suit your requirements. mapfile.a2e contains the ASCII to EBCDIC conversion table; mapfile.e2a contains the corresponding EBCDIC to ASCII conversion table.
  6. Enter:
    codecomp mapfile.a2e mapfile.e2a

    A codeset.cpy file is created in the current directory.

  7. Enter:
    copy "%ProgramFiles(x86)%\Micro Focus\Visual COBOL for Visual Studio 2013\src\codeset\csnnnn.cbl" csnnnn.cbl
    Note: For 32-bit Windows, %ProgramFiles(x86)% becomes %ProgramFiles%.

    where %ProgramFiles(x86)%\Micro Focus\Visual COBOL for Visual Studio 2013 is your installation directory and nnnn is a number between 2000 through 9999 (excluding 9122) that you use to refer to your customized codeset module.

  8. Enter:
    cbllink -d csnnnn.cbl
  9. Copy the resulting executable module CSnnnn.dll to a directory that is specified on the PATH.