Steps for setting up your national code page
If you will be using Japanese or Simplified Chinese, you still need to do these steps first before going on to Customizing for Japanese and Simplified Chinese.
- For the z/OS shell, copy /samples/profile to /etc/profile. You might have already done this, as described in Customizing /etc/profile.
- For the tcsh shell, copy /samples/csh.login to /etc/csh.login. You might have already done this, as described in Customizing /etc/csh.login.
Perform the following steps to set up your national code page for shell users.
- Customize the login file for your shell.
For this shell Do this . . . z/OS shell Customize /etc/profile so that your selected national page is enabled when the shell is first invoked. Be careful that the shell, with the updated /etc/profile, does not keep restarting itself after you restart the shell. Tip: To make sure that exec sh -L is executed only once, you can copy the code in the sample /etc/profile and update it with your national code page.
tcsh shell Customize /etc/csh.login so that your selected national page is enabled when the tcsh shell is first invoked. Be careful that the shell, with the updated /etc/csh.login does not keep restarting itself after you restart the shell. Tip: To make sure that exec sh -l is executed only once, you can copy the code shown in the sample /etc/csh.login, and update it with your national code page.
_______________________________________________________________
- Convert from ASCII to your national code page. Use the chcp command
to change the data conversion for rlogin sessions.
- For the z/OS shell,
the following sample /etc/profile shows examples of statements
to convert the terminal session data using ASCII code page ISO8859-1
and EBCDIC code page IBM-277. This example uses the Danish locale.
if test -z "$LOCALE_SWITCH" && tty -s then echo " - - - - - - - - - - - - - - - - - - - - - - - - - - - " echo " - Logon shell will now be invoked to reflect - " echo " - code page IBM-277 - " echo " - - - - - - - - - - - - - - - - - - - - - - - - - - - " LOCALE_SWITCH=EXECUTED LANG=C LC_ALL=Da_DK.IBM-277 export LANG LC_ALL LOCALE_SWITCH # Issue chcp if not using OMVS command if test "$?_BPX_TERMPATH != "OMVS" ) then chcp -a IS08859-1 -e IBM-277 fi exec sh -L else echo " - - - - - - - - - - - - - - - - - - - - - - - - - - - " echo " - Welcome to z/OS UNIX System Services -" echo " - - - - - - - - - - - - - - - - - - - - - - - - - - - " fi
- For the tcsh shell, the following sample /etc/csh.login shows
examples of statements to convert the terminal session data using
ASCII code page ISO8859-1 and EBCDIC code page IBM-277. This example
uses the Danish locale.
tty -s set tty_rc=$status if (($?LOCALE_SWITCH == 0 && tty_rc == 0)) then echo " - - - - - - - - - - - - - - - - - - - - - - - - - - - " echo " - Logon shell will now be invoked to reflect - " echo " - code page IBM-277 - " echo " - - - - - - - - - - - - - - - - - - - - - - - - - - - " setenv LOCALE_SWITCH=EXECUTED setenv LANG=C setenv LC_ALL=Da_DK.IBM-277 # Issue chcp if not using OMVS command if ($?_BPX_TERMPATH != "OMVS" ) then chcp -a ISO8859-l -e IBM-277 endif exec tcsh -l endif unset tty_rc
_______________________________________________________________
- For the z/OS shell,
the following sample /etc/profile shows examples of statements
to convert the terminal session data using ASCII code page ISO8859-1
and EBCDIC code page IBM-277. This example uses the Danish locale.
- Convert these files to your selected locale, using the iconv command.
- /etc/yylex.c
- /etc/mailx.rc
- /etc/startup.mk
- /etc/yyparse.c
Example: To convert /etc/mailx.rc to be used in the Da_DK.IBM-277 locale, issue:iconv -f IBM-1047 -t IBM-277 /etc/mailx.rc >/etc/mailx.rc.277
_______________________________________________________________
- Update BPXBATCH or OSHELL, if necessary.
Tip: If you use BPXBATCH or OSHELL (which uses BPXBATCH), you must do this step in order to get the code page working immediately under BPXBATCH and OSHELL. Use the STDENV ddname to point to a file or data set that contains the environment variable definitions for the code page. The code page you specify will not affect the shell because ddname is read before the first shell is invoked, (Because the STDENV DD statement does not affect the OMVS command, you need to put the environment variables in /etc/profile.)
For more information about BPXBATCH and STDENV, see z/OS V2R2.0 UNIX System Services User's Guide.
_______________________________________________________________
- If you need to customize for Japanese or Simplified Chinese, go
to Customizing for Japanese and Simplified Chinese.
_______________________________________________________________
- If you do not need to customize for Japanese or Simplified Chinese,
save the login file.
- For the z/OS shell, it is /etc/profile.
- For the tcsh shell, it is /etc/csh.login.
_______________________________________________________________
When you are done, you have set up your national code page.
echo $HOME
If
you entered the shell before the code page was set up, you will see
$HOME. Otherwise, the shell will display the path name of your home
directory. The $ should be read as your code page's dollar sign.