To customize character set conversion

Note: When creating a customized character set conversion, the resulting program will not be thread safe. This will cause problems in the Communications Process (MFCS), resulting in memory corruption.

To prevent this, insert a Local-Storage Section declaration immediately after the Working-Storage Section in the %ProgramFiles(x86)%\Micro Focus\Visual COBOL for Visual Studio 2012\src\codeset\csnnnn.cbl file, where nnnn is the 4-digit country code.

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

    where nnnn is the supported 4-digit country code 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 folder.

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

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

  7. Enter:
    Windows:
    copy "%ProgramFiles(x86)%\Micro Focus\Visual COBOL for Visual Studio 2012\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 2012 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:
    Windows:
    cobol csnnnn.cbl omf(gnt);
  9. Enter:
    For 32-bit Windows environments:
    copy csnnnn.gnt "%ProgramFiles%\Micro Focus\Visual COBOL for Visual Studio 2012\bin"
    For 64-bit Windows environments:
    copy csnnnn.gnt "%ProgramFiles(x86)%\Micro Focus\Visual COBOL for Visual Studio 2012\bin64"
    Note: For 32-bit Windows, %ProgramFiles(x86)% becomes %ProgramFiles%.

    where %ProgramFiles(x86)%\Micro Focus\Visual COBOL for Visual Studio 2012 is your installation directory and nnnn is the customized codeset number.