Previous Topic Next topic Print topic


SQL Option NLS Environment

SQL Option allows you to create XDB locations that emulate all the various mainframe EBCDIC code pages. When you access these locations with SQL Wizard or a COBOL program, your data in these locations appears identical to the data on the mainframe.

The five steps necessary to ensure complete compatibility with the mainframe and/or your COBOL development system are as follows:

  1. Decide which EBCDIC code page you want to emulate.

    Typically, you would use the mainframe's code page. (If you do not know what it is, you may be able to use XDB Link to find out.) If you do not have a mainframe, you can choose whichever code page you prefer.

  2. Create a local EBCDIC location for this code page.

    Use SQL Wizard's Create Location dialog box. Pick the EBCDIC code page you want in the Sort Sequence box.

  3. Ensure that your project's national language support (NLS) setting is the same as your EBCDIC location.

    When you compile a COBOL program with Studio Enterprise Edition, it can be associated with a particular EBCDIC code page.

  4. If you have XDB Link, configure it to access the mainframe.

    Use the Gateway Profile utility to define your DB/2 locations to the PC software, then specify the single Workstation Code Page as 911 (in the local Workstation Configuration). Next, use SQL Wizard to access the DB/2 location on the mainframe. A file named cpg_info.txt is created in the %ProgramFiles(x86)%\Micro Focus\Studio Enterprise Edition x.x\base\bindirectory by default, identifying the EBCDIC code page of the DB/2 location on the mainframe. The following table defines this EBCDIC code page number:

    NLS Setting Code Page Number
    31 Dutch 37
    33 French 297
    34 Spanish 284
    39 Italian 280
    43 Austrian German 273
    44 English (UK) 285
    45 Danish 277
    46 Swedish 278
    47 Norwegian 277
    49 German 273
    351 Portugese 37
    358 Finnish 278
    437 English (US) 37
    500 International 500
  5. Populate your local EBCDIC location with data from the mainframe.

    If you have XDB Link for the mainframe, there are two ways to do this: using Migrate or using SQL Wizard.

    • To use Migrate, all you need to do is point to the DB/2 location on your mainframe as the source location, and point to the local EBCDIC location as the destination location.
    • To use SQL Wizard, first export your mainframe's data in DSNTIAUL format, then import it into SQL Wizard. When you use the DSNTIAUL format, you need to specify a code page translation for both exports and imports: for exports, use the PC's ANSI code page to EBCDIC code page translation; for imports, use the reverse translation. For example, suppose you want to extract from a Swedish EBCDIC DB/2 location. For the export, you would pick the ANSI to EBCDIC translation 1252 - 278, for the import, 278 - 1252.

    If you don't have XDB Link for the mainframe, extract the data from the mainframe into a file with DSNTIAUL format, then import the data into your local EBCDIC location using SQL Wizard's import function, citing the appropriate EBCDIC to ANSI code page translation.

XDB EBCDIC databases are stored using the default OEM character set for your machine (typically, code page 437 in the United States, or code page 850 almost everywhere else). The names of database objects such as tables and indexes are also validated using this character set. You can optionally specify that database object-names should be validated using any of the following character sets if, for example, you want to use accented characters in the names:

MS-DOS Code Page Character Set
437 US Latin 1
850 International Latin 1
857 Turkish
863 French Canada
865 Nordic
860 Portuguese

To specify that an XDB Server should use one of the supported code pages for name validation, you must add two lines to the xdb.ini file in %ProgramFiles(x86)%\Micro Focus\Studio Enterprise Edition x.x\mfsql\cfg:

[SERVER] XDBCP=codepage 

where codepage is the three-digit number of the code page you require.

Where a location has been created as an EBCDIC location (for example, the default location, MAINTAIN), data is automatically converted to EBCDIC before it is passed to the client application. Conversion between ASCII data on the PC and EBCDIC data on the mainframe is handled by the DB2 Link gateway if you are using the Migrate utility. If you are using the data import and export facilities in SQL Wizard, you can control the conversion used by choosing the DSNTIAUL data format and selecting an appropriate code page conversion. See the topics Import/Export NSL Considerations for more information.

For information about EBCDIC conversions and the Data File Converter, see the topic Converting Data Files.

Previous Topic Next topic Print topic