Rational Developer for System z
COBOL for Windows, Version 7.5, Programming Guide


Using environment variables to specify a locale

Use any of several environment variables to provide the locale information for a COBOL program.

To specify a code page to use for all of the locale categories (messages, collating sequence, date and time formats, character classification, and case conversion), use LC_ALL.

To set the value for a specific locale category, use the appropriate environment variable:

Any locale category that has not been specified by one of the locale environment variables above is set from the value of the LANG environment variable.

Use the following format to set the locale environment variables (.codepageID is optional):

SET LC_xxxx=ll_CC.codepageID

Here LC_xxxx is the name of the locale category, ll is a lowercase two-letter language code, CC is an uppercase two-letter ISO country code, and codepageID is the code page to be used for native DISPLAY and DISPLAY-1 data. COBOL for Windows uses the POSIX-defined locale conventions.

For example, to set the locale to Canadian French encoded in IBM-863, issue this command in the command window from which you compile and run a COBOL application:

SET LC_ALL=fr_CA.IBM-863

You must code a valid value for the locale name (ll_CC), and the code page (codepageID) that you specify must be valid for the locale name. Valid values are shown in the table of supported locales and code pages referenced below.

related concepts
Determination of the locale from system settings

related tasks
Specifying the code page with a locale

related references
Locales and code pages that are supported
Runtime environment variables


Terms of use | Feedback

Copyright IBM Corporation 1996, 2008.
This information center is powered by Eclipse technology. (http://www.eclipse.org)