z/OS UNIX System Services Planning
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Steps for setting up your national code page

z/OS UNIX System Services Planning
GA32-0884-00

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.

Before you begin: You need to have the login file for your shell.
  1. For the z/OS shell, copy /samples/profile to /etc/profile. You might have already done this, as described in Customizing /etc/profile.
  2. 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.

  1. 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.

    _______________________________________________________________

  2. 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

    _______________________________________________________________

  3. Convert these files to your selected locale, using the iconv command.
    • /etc/yylex.c
    • /etc/mailx.rc
    • /etc/startup.mk
    • /etc/yyparse.c
    The lex, mailx, make, and yacc utilities expect both system files and user files to be in the same code page.
    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

    _______________________________________________________________

  4. 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 UNIX System Services User's Guide.

    _______________________________________________________________

  5. If you need to customize for Japanese or Simplified Chinese, go to Customizing for Japanese and Simplified Chinese.

    _______________________________________________________________

  6. 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.

Tip: To verify your code page, issue:
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.

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014