DIGITAL TCP/IP Services for OpenVMS
Management


Previous | Contents

To modify the translation tables, use one of these files:

E.1 Macros for Modifying the Translation Tables

If the standard translation tables do not suit your needs, you can modify them by specifying macros in the file SNATRATBL.MAR. You should copy SNATRATBL.MAR from SYS$LIBRARY into your current default directory and edit it with any editor supported by your system.

Use the macros described to make any changes you need in the translation tables. You can specify three macros. The arguments for all three macros are:
eb The EBCDIC code for the character you want to translate.
as The DMCS code for the character you are translating to. (If you want to specify the actual DMCS display character instead of the code, you can. To do this, enter a single quotation mark before you type the character; for example, '!, 'A, 'g, and so on.)

The macros are:

  1. EB2AS eb, as
    The EB2AS macro lets you change an entry in the EBCDIC-to-DMCS table without affecting the DMCS-to-EBCDIC table.
    For example:
    EB2AS 5A, '!
    In this example, the EBCDIC hexadecimal code 5A is translated to the DMCS exclamation point (hexadecimal code 21). The macro does not affect the translation of a DMCS exclamation point to its EBCDIC equivalent.
  2. AS2EB as, eb
    The AS2EB macro lets you change an entry in the DMCS-to-EBCDIC table without affecting the EBCDIC-DMCS table.
    For example:
    AS2EB '[, 5F
    In this example, the DMCS open bracket character (hexadecimal code 5B) is translated to the EBCDIC hexadecimal code 5F. The macro does not affect the translation of the EBCDIC code 5F to DMCS.
  3. REVTRA eb, as
    The REVTRA macro combines the functions of the EB2AS and AS2EB macros, enabling you to change the same translation in both the DMCS-to-EBCDIC and EBCDIC-to-DMCS tables.
    For example:
    REVTRA 4A, A2
    In this example, the macro changes the EBCDIC-to-DMCS translation table so that the EBCDIC character represented by the hexadecimal code 4A translates to a DMCS cent sign (hexadecimal code A2.) The DMCS-to-EBCDIC translation table is also changed so that a DMCS cent sign translates to the EBCDIC character represented by the hexadecimal code 4A.

    NOTE

    If you use the REVTRA macro, you must give new translations to the codes used as arguments to the macro. You can do this with the EB2AS and AS2EB macros.

E.2 Building Translation Tables

Before you edit the template file, save the original by copying it from SYS$LIBRARY to your current default directory.

Edit the file using any editor your system supports. When you have changed the template file to your satisfaction, perform the following steps:

  1. Assemble the template file you just edited with the prefix file on your system called SNATRAPRE.MAR:
    $ MACRO/OBJECT=SNATRATBL SYS$LIBRARY:SNATRAPRE+SYS$DISK:[]SNATRATBL
    

    When you assemble the template file, you create an object file containing two 256-byte translation tables labeled $AS2EB:: and $EB2AS::. This object file can be linked into a user application program.
  2. Link the template file to create the translation table:
    $ LINK/SYSTEM/HEADER SNATRATBL
    
  3. Copy the resulting image to an accessible area:
    $  COPY SNATRATBL.EXE SYS$LIBRARY:SNATEDEF.TBL
    

E.3 Examples of Modifying Translation Tables

This section gives two examples of modifying translation tables. Example 1 shows how to translate the ASCII left bracket to the EBCDIC cent sign. Example 2 shows how to modify the standard translation tables to the translation tables used by the TN3270 Terminal Emulator.

Example 1

The following code segment translates the ASCII left bracket, hexadecimal code 5B, to the EBCDIC cent sign, hexadecimal code 4A. The change causes the EBCDIC cent sign to be translated into the ASCII cent sign, hex A2. When the REVTRA macro is used, it leaves the ASCII left bracket unmapped, and a second macro, AS2EB, is used to map the ASCII left bracket to the EBCDIC SUB character, hex code 3F.

        DMFILL  = 26.           ; This argument causes all the EBCDIC 
                                ; characters that normally map to an ASCII 
                                ; backslash in the standard table to map 
                                ; to an ASCII SUB character, code 26 
                                ; decimal, 1A hexadecimal. 
 
        REVTRA  4A,A2           ; Map the EBCDIC cent character (4A) 
                                ; to/from the ASCII cent character (A2). 
                                
        AS2EB   5B,3F           ; Map the ASCII "[" (5B) to the EBCDIC 
                                ; SUB character (3F). 
 
; 
; The preceding macro could also be written in the following way: 
;         AS2EB '[,3F 

Example 2

This example shows the macros used to modify the standard translation tables to the translation tables used by IBM 3270TE. Table E-1 describes the required changes.

        DMFILL  = 26. 
 
        REVTRA  4A,A2           ; Map the EBCDIC cent character (4A) 
                                ; to/from the ASCII cent character (A2). 
                                ; Because this macro leaves ASCII "[" (5B) 
                                ; still mapped to the EBCDIC cent character 
                                ; (4A) , it must be remapped. 
        
        REVTRA  4F,7C           ; Map the EBCDIC "|" (4F) to/from 
                                ; the ASCII "|" (7C). 
 
        REVTRA  6A,A1           ; Map EBCDIC "dashed vbar" (6A) to/from ASCII 
                                ; inverted ! (A1). 
 
        REVTRA  5A,'!           ; Map EBCDIC "!" (5A) to/from ASCII "!" (21). 
 
        AS2EB   '],3F           ; Map ASCII "]" (5D) to the EBCDIC SUB 
                                ; character (3F). 
 
        AS2EB   5B,3F           ; Map the ASCII "[" (5B) to the EBCDIC 
                                ; SUB character (3F). 

The changes that are described modify a version of the ANSI standard X3.26 1970 EBCDIC-to-ASCII translation table. Table E-1 shows these modifications:

Table E-1 Modifications to Translation Tables
DMCS
Character
Hexadecimal
Code
EBCDIC
Character
Hexadecimal
Code
¢ A2 ¢ 4A
| 7C | 4F
! 21 ! 5A
¡¹ A1 dashed vbar 6A
[ 5B ²
] 5D ²


¹The display of these characters depends on the type of terminal.
²These characters translate to the EBCDIC SUB character, which has an EBCDIC code of 63 decimal (3F hexadecimal). The DMCS contains 256 characters. The first 128 characters are the same as the standard ASCII character set. None of the remaining characters map to a printable EBCDIC character; therefore, they translate to the EBCDIC SUB character.


Appendix F
How NFS Converts File Names

The NFS to OpenVMS file name translation rules in Table F-1 are based on the character mapping scheme in Table F-2. The OpenVMS to NFS mapping rules are the converse of these rules.

Table F-1 NFS Server to OpenVMS Client File Name Conversion Rules
Rule What Happens to File Names from NFS to OpenVMS
1 Lowercase characters become uppercase (unless Rule 2 applies):
file becomes FILE.;1
2 Initial uppercase characters or a sequence of case-shifted characters are prefixed with the "$" escape character.
CaseShiftedFile becomes $C$ASE$S$HIFTED$F$ILE.;1
3 A file without a version gets a version number preceded by a semicolon:
file becomes FILE.;1
4 If a file name does not include a dot (.), a dot is added before the version number semicolon:
file becomes FILE.;1
5 After its name is converted, a file will not appear in an OpenVMS directory listing if any one of the following criteria are met:
  • The file name is more than 39 characters long
  • The file extension is more than 39 characters long
  • The version number is greater than 32767
6 If the file name has a dot, the dot is preserved unless the resulting file name fails one of the tests in Rule 5; if so, the dot becomes "$5N" and the same rule applies to each subsequent dot found:
more.file.text becomes MORE.FILE$5NTEXT;1
7 If the file name is a directory, each dot becomes "$5N" and the file name gets the ".DIR" extension:
dot.directory.list becomes DOT$5NDIRECTORY$5NLIST.DIR;1
8 Invalid OpenVMS characters become the escape character sequences in the second column of Table F-2 ("$" followed by a digit and a letter): special#character&file becomes SPECIAL$5CCHARACTER$5FFILE.;1 ("#" becomes "$5C" and "&" becomes "$5F")
9 Any existing "$" becomes "$$" (plus any "$" added due to Rule 2 or 8 above):
dollar$Sign$5cfile becomes DOLLAR$$$S$IGN$$5CFILE.;1

Table F-2 provides a complete list of OpenVMS character sequences, corresponding server characters, and octal values used for NFS name conversion.

Table F-2 NFS Client: Name Conversion
OpenVMS Character Sequence Server Character Octal Value
$6A <CTRL/@> 000
$4A <CTRL/A> 001
$4B <CTRL/B> 002
$4C <CTRL/C> 003
$4D <CTRL/D> 004
$4E <CTRL/E> 005
$4F <CTRL/F> 006
$4G <CTRL/G> 007
$4H <CTRL/H> 010
$4I <CTRL/I> 011
$4J <CTRL/J> 012
$4K <CTRL/K> 013
$4L <CTRL/L> 014
$4M <CTRL/M> 015
$4N <CTRL/N> 016
$4O <CTRL/O> 017
$4P <CTRL/P> 020
$4Q <CTRL/Q> 021
$4R <CTRL/R> 022
$4S <CTRL/S> 023
$4T <CTRL/T> 024
$4U <CTRL/U> 025
$4V <CTRL/V> 026
$4X <CTRL/W> 027
$4X <CTRL/X> 030
$4Y <CTRL/Y> 031
$4Z <CTRL/Z> 032
$6B <CTRL/[> 033
$6C <CTRL/\>> 034
$6D <CTRL/]> 035
$6E <CTRL/^> 036
$6F <CTRL/_> 037
$7A <SPACE> 040
$5A ! 041
$5B " 042
$5C # 043
$5E % 045
$5F & 046
$5G ' 047
$5H ( 050
$5I ) 051
$5J * 052
$5K + 053
$5L , 054
$5N . 056
i$5O / 057
$5Z : 072
$7B ; 073
$7C < 074
$7D = 075
$7E > 076
$7F ? 077
$8A @ 100
$8B [ 133
$8C \ 134
$8D ] 135
$8E ^ 136
$9A ` 140
$9B { 172
$9C | 174
$9D } 175
$9E ~ 176
$9F <DEL> 177


Index | Contents