Terminal Emulation

A terminal emulation window (which is not Unicode-enabled) is used in a remote development environment to display non-GUI information. This is different from the local environment where the output is shown in an output window.

Exception: In a remote Windows environment, the Natural Web I/O Interface client is always used instead of a terminal emulation window.

This document covers the following topics:


About Terminal Emulation

When specific parameters have been set on the Natural Development Server (see below), the terminal emulation window is used instead of the Natural Web I/O Interface client.

The following example shows the terminal emulation window containing the output of a program that has been executed in a remote environment.

Terminal emulation

Terminal emulation enables you to test a complete application, including all of its character output, without having to leave Natural Studio. A screen output of an executed program automatically causes the terminal emulation window to be opened and to be closed again when the program terminates (logically, the development server session reaches the NEXT level).

The terminal emulation window cannot be closed manually using the standard Windows close button. As long as terminal emulation is active, you cannot work with Natural Studio.

Utilities for which Natural Studio does not offer a graphical user interface in the remote environment are also made available by terminal emulation. Entering the corresponding system command in Natural Studio's command line automatically opens the terminal emulation window.

Prerequisites for the Natural Development Server

So that the terminal emulation window can be invoked, the Natural development server (NDV) has to be configured as follows:

  • Linux
    If you want to use the terminal emulation window in a remote Linux environment, the profile parameter WEBIO must be set to "OFF" on the NDV server. See Configuration Utility in the Natural on Linux and Cloud documentation.

  • Mainframe
    If you want to use the terminal emulation window in a remote mainframe environment, the NDV configuration parameter TERMINAL_EMULATION must not be set to "WEBIO" on the NDV server. See NDV Configuration Parameters in the Natural Development Server documentation.

  • Windows
    In a remote Windows environment, the Natural Web I/O Interface client is always used instead of the terminal emulation window, regardless of the setting of the profile parameter WEBIO.

Working in a Terminal Emulation Screen

In a the terminal emulation screen, you can use both mouse and keyboard. To change the cursor position, use the standard keys (e.g. TAB or the arrow keys) or the mouse. To use a host function key, press the terminal emulation key assigned to this function key. To simulate the ENTER key, double-click any position in the terminal emulation screen. Otherwise, you can use your keyboard to enter data as normal.

Displaying a Keypad

A keypad contains buttons that represent host function keys. You can display several keypads in the terminal emulation window. The following is an example of the keypad containing the 3270 keys.

graphics/spod-keypad.png

Start of instruction setTo switch the display of a keypad on and off

  • From the View menu, choose keypad-name.

    When a keypad is displayed, a check mark is shown next to its name.

Transferring Data Using the Clipboard

Using the commands from the Edit menu, you can copy or cut a terminal emulation screen (or part of it) and paste it somewhere else (for example, in another terminal emulation screen or in a PC application, such as, Microsoft Word). You can also copy or cut text from a PC application and paste it in a terminal emulation screen. Cut or copied data is stored on the Windows Clipboard.

You must first select the desired text before you can use the Cut, Copy or Append Copy command.

The following rules apply for a terminal emulation screen:

  • You can only cut text from unprotected fields. If protected fields have been selected, they are copied.

  • When you use the Cut or Copy command, the content of the clipboard is deleted and replaced with the new text. If you want to add data to the clipboard, you must use the Append Copy command.

  • When you use the Append Copy command, the content of the clipboard is not deleted. The selected text is inserted behind already existing text on the clipboard. When you then choose the Paste command, the whole content of the clipboard is inserted at cursor position.

  • You can only paste text into unprotected fields. If the field is not long enough, it is filled up to its maximum size and the remaining text is inserted in the next unprotected field(s). Example: the text to be pasted is "DISPLAY" and the cursor is located in a two character long input field. In this case, only the first two characters ("DI") are pasted into the input field.

Unless indicated otherwise, the left mouse button is always used. The right mouse button is used to select the Edit menu commands from a context menu.

Start of instruction set To select part of a terminal emulation screen (mouse usage)

  1. Move the mouse pointer to the beginning of the text you want to select.

  2. Press and hold down the left mouse button.

    This clears any previous selection.

  3. Drag the mouse until all desired text is selected.

  4. Release the mouse button.

    You can now cut, copy or append the selected text.

Start of instruction setTo select part of a terminal emulation screen (keyboard usage)

  1. Use the arrow keys to move the cursor to the beginning of the text you want to select.

    This clears any previous selection.

  2. Press and hold down SHIFT.

  3. Use the arrow keys to select the desired text.

  4. Release SHIFT.

    You can now cut, copy or append the selected text.

    Note:
    When holding down CTRL+SHIFT and then using the arrow keys, all text to the end of the line (with RIGHT-ARROW) or to the bottom of the screen (with DOWN-ARROW) is selected.

Start of instruction setTo select the entire content of the terminal emulation screen

  • From the Edit menu, choose Select All.

    Or:
    Press CTRL+A.

    A box outline is shown around the terminal emulation screen.

    You can now cut, copy or append the selected text.

Start of instruction setTo cancel the selection

  • Click another screen position.

    Or:
    When using the keyboard, just select another part of the terminal emulation screen as described above.

    The previous selection is canceled.

Start of instruction setTo delete the selection in an unprotected field

  • From the Edit menu, choose Delete.

    Or:
    Press DEL.

    Or:
    Invoke the context menu and choose Clear.

    The selection is deleted. It is not transferred to the clipboard.

Start of instruction set To copy the selection and append it behind existing text in the clipboard

  • Invoke the context menu and choose Append Copy.

    The selection is copied to the clipboard and appended behind already existing text.

Start of instruction set To cut the selection and transfer it to the clipboard

  • From the Edit menu, choose Cut.

    Or:
    Press CTRL+X.

    The selection is deleted and transferred to the clipboard. Exception: protected fields are not deleted; they are copied.

Start of instruction set To copy the selection to the clipboard

  • From the Edit menu, choose Copy.

    Or:
    Press CTRL+C.

Start of instruction set To paste the content of the clipboard into a terminal emulation screen

  1. Move the cursor to the position at which the text is to be inserted.

  2. From the Edit menu, choose Paste.

    Or:
    Press CTRL+V.

    The content of the clipboard is inserted at cursor position.

Modifying the Font

You can define another font to be used for terminal emulation.

Start of instruction setTo modify the font

  1. From the Session menu, choose Font.

    The Fonts dialog box appears.

    Font

  2. Define the desired font and font style.

    The Adjust the font size to the window size check box applies to raster fonts only. For TrueType fonts, automatic resizing is always enabled. Select this check box to adjust the size of the selected font to the window size. Adjusting the font size is done by increasing or reducing the spacing between characters and lines. This may result in truncated characters.

    The Script drop-down list box contains a list of all available language scripts for the selected font. Make sure to specify a script that is compatible with the language that has been set up for your computer.

  3. Choose the OK button.

Modifying the Color Scheme

You can define another color scheme to be used for terminal emulation.

Start of instruction setTo activate another color scheme

  1. From the Session menu, choose Color.

    The Color Selection dialog box appears.

    Color selection

    The dialog box lists all color schemes that are available for the currently connected environment (for example, mainframe).

    The active color scheme is indicated by an arrow. When the lock symbol next to the color scheme name shows a green check mark, the color scheme can be modified. When it shows a red cross, it cannot be modified; it can only be duplicated in this case.

  2. Select the color scheme you want to activate.

  3. Choose the OK button.

Command Buttons

Besides activating another color scheme, you can also create, modify, delete or duplicate a color scheme. To do so, use one of the following command buttons in the Color Selection dialog box:

Command Button Description
Modify Modifies the selected color scheme. You can only modify the color scheme which is currently active. If you select another color scheme, you are asked whether you want to make the selected color scheme active in order to continue.
New Creates a new color scheme. Specify a name for the new color scheme in the resulting dialog box and choose the OK button. You are then asked whether you want to make the new color scheme active in order to modify it.
Delete Deletes the selected color scheme. You are asked to confirm the deletion. The predefined color schemes cannot be deleted.
Duplicate Creates a copy of the selected color scheme. Specify a name for the copy in the resulting dialog box and choose the OK button. You are then asked whether you want to make the copy active in order to modify it.

Detailed information on the dialog box which appears when you create, modify or duplicate a color scheme is provided below. Depending on the currently connected environment, one of the following dialog boxes appears:

The color scheme name can be up to 32 characters long and may contain blanks. It can only be specified when adding a new color scheme. Later, the name cannot be modified.

Mainframe Color Scheme

Mainframe color scheme

When you move the mouse pointer over the sample screen that is shown in the Mainframe Color Scheme dialog box, tooltips appear. The name of the base (field) color or extended color attribute is shown on the left of the tooltip. The name of the background color is shown on the right of the tooltip.

Start of instruction setTo define other colors

  1. Select a text entry from the first drop-down list box in one of the following group boxes:

    • Base (field) color
      The colors for the different field types in a terminal emulation screen.

    • Extended color attribute
      The extended colors sent by the host application. For example, you can specify that all fields with the extended color attribute "Green" are to appear blue in the terminal emulation screen.

    • Background color
      The background colors for specific field types. The background color underlays text. If the field contains no text, the field area is colored with the background color.

  2. Select the desired color from the corresponding drop-down list box to the right.

    This drop-down list box also provides the following buttons:

    • Other
      Lets you define additional colors.

    • Default
      Resets the modified color palette to the default colors.

  3. Repeat the above steps until all desired colors have been defined. The Mainframe Color Scheme dialog box always reflects the current color settings.

  4. Optional - choose the Apply button to save the current color settings without closing the dialog box.

  5. Choose the OK button.

VT Color Scheme

VT color scheme

When you move the mouse pointer over the sample screen that is shown in the VT Color Scheme dialog box, tooltips appear. The following applies for the ANSI color attributes: the name of the foreground color is shown on the left of the tooltip, and the name of the background color is shown on the right of the tooltip.

Start of instruction setTo define other colors

  1. Select a text entry from the first drop-down list box in one of the following group boxes:

    • Foreground color attribute
      The foreground color for the terminal emulation screen. The VT terminal type 340+ uses this setting when starting the session and as long as no specific color commands are sent by the host. All other VT terminal types use this setting during the entire session.

    • ANSI color attributes
      When the VT terminal type 340+ (color terminal) is set in Natural on the host, the host can send color commands for the foreground and background. In this mode, eight color attributes are available. For each possible character position or cursor position, the host can set a foreground and background color. You can modify the colors belonging to the color attributes (see below).

    • Background color attribute
      The background color for the terminal emulation screen. The VT terminal type 340+ uses this setting when starting the session and as long as no specific color commands are sent by the host. All other VT terminal types use this setting during the entire session.

  2. Select the desired color for an ANSI color attribute from the corresponding drop-down list box to the right.

    This drop-down list box also provides the following buttons:

    • Other
      Lets you define additional colors.

    • Default
      Resets the modified color palette to the default colors.

  3. Repeat the above steps until all desired colors have been defined.

    The VT Color Scheme dialog box always reflects the current color settings.

  4. Optional - choose the Apply button to save the current color settings without closing the dialog box.

  5. Choose the OK button.

Printing the Contents of a Terminal Emulation Screen

You can print the contents of the terminal emulation screen on a printer that is defined under Windows.

Start of instruction setTo preview the screen to be printed

  1. From the Session menu, choose Print Preview.

    The print preview window appears.

  2. Optionally: use the Zoom In and Zoom Out buttons to view the information in this window. Or choose the Print button to invoke the Print dialog box.

  3. To return to the terminal emulation screen, choose the Close button.

Start of instruction setTo print the screen contents using a dialog box

  1. From the Session menu, choose Print.

    Or:
    Press CTRL+P.

    The Print dialog box appears.

  2. Choose the OK button to print the current screen.

Start of instruction setTo print the screen contents directly, without displaying a dialog box

  • Press the PRINT SCREEN key.

    The contents of the current terminal emulation screen are immediately printed. The current printer settings are used.

Terminal Emulation Keys

Keys such as PF1 or PA1 which start a terminal function can be used either by choosing the corresponding button in a keypad or by pressing the corresponding key combination.

The following table lists all available key combinations. When you have to press SHIFT or CTRL, this is indicated by an X. For example, when you want to use PF13, you have to press SHIFT+F1.

Terminal Keyboard PC Keyboard
3270 Key SHIFT CTRL F-Key
CLR   X F1
ENTR   X F2
EEOF   X F3
ERI   X F4
INS   X F5
NLIN   X F6
HOME   X F7
PA1   X F8
PA2   X F9
PA3   X F10
PF1 through PF12     F1 through F12
PF13 through PF24 X   F1 through F12
RESET   X F11

Using Non-Latin Character Sets

By default, the Latin character set is used for terminal emulation (3270 translation).

You can define a different character set (e.g. Cyrillic) to be used for the terminal emulation. See Workspace Options in the documentation Using Natural Studio for further information.

Note:
When you define another character set, you may have to modify the font of the terminal emulation. See Modifying the Font.

Translation Tables

Translation tables convert characters when sending or receiving data to or from a host while using terminal emulation. Translation tables contain hexadecimal values which correspond to a national code page.

The following topics are covered below:

Translation Table Files

Each language setting has its own translation file. This file contains the character translation tables for translations from the PC to the host and vice versa. The file name reflects the communication mode. The extension of a translation file is ".tra".

In the case of a default installation, the translation files can be found in the following folder:

<drive>:\Program Files (x86)\Common Files\Software AG\Natural\V1\etc

The following translation files are available:

  • N3270_USER1.tra

  • N3270_USER2.tra

  • N3270_USER3.tra

  • N3270_USER4.tra

These files give you the opportunity to create your own character translation tables.

Each file contains two translation tables where each table corresponds to one communication direction (one for sending and one for receiving). Example:

  • ASC2xxxyy
    Translation table for PC-to-host communication.

  • xxxyy2ASC
    Translation table for host-to-PC communication.

The table names contain the following information:

Part of Name Description
ASC2 or 2ASC Code page on the PC. Standardized name convention.
xxx Code page on the host. Can be defined by the user.
yy Language. Can be defined by the user.

Table Structure

The table for PC-to-host communication contains the hexadecimal values for the host code page. The row and column names correspond to the hexadecimal value of the PC code page.

The table for host-to-PC communication contains the hexadecimal values for the PC code page. The row and column names correspond to the hexadecimal value of the host code page.

The first set of characters of the hexadecimal value indicates the row and the second set indicates the column.

Example

The character "b" in the file N3270_USER1.tra has the following hexadecimal values:

Code Page (communication from) Hexadecimal Value Location
Host 82 Row 08, column 02
PC 62 Row 06, column 02

Adapting and Importing Translation Tables

Translation tables must be adapted in the following situations:

  • When a character sent from the PC to the host (or vice versa) is translated or displayed differently than it was sent.

  • When the tables lack special regional characters.

To adapt a translation table, use a code page which corresponds to the host or PC code page settings. You can obtain code pages as graphics from https://msdn.microsoft.com/de-de; look for a link to "References > Code Pages".

Important:
Make backups of all ".tra" files before beginning.

When the translation tables have been adapted, you have to import them as described below. Entire Connection's Configuration Manager is used for importing the translation tables. With a default installation, the file PCCAdmin.exe, which invokes the Configuration Manager, is provided in the following Natural folder:

<drive>:\Program Files (x86)\Common Files\Software AG\Natural\V1\Terminal\configmgr

Note:
Documentation for Entire Connection's Configuration Manager can be found at http://documentation.softwareag.com/ (Empower login required).

Start of instruction setTo import the adapted translation tables

  1. Execute the file PCCAdmin.exe to start the Configuration Manager.

    If user information is required, a logon dialog box appears

  2. In the logon dialog, enter your user name and, if required, password. The default user name is "SYSTEM".

  3. From the File menu choose Open Share File.

  4. In the resulting dialog box, select the file NATSHARE411.sag and choose the Open button. This file is located in the following folder:

    <drive>:\Program Files (x86)\Common Files\Software AG\Natural\V1\etc

  5. In the left pane of the Configuration Manager, expand the node Tables and then select the node Translation.

  6. From the Edit menu, choose Import Table.

  7. In the resulting dialog box, select the translation table files that you want to import and choose the Import button.

  8. Confirm that the translation tables for the user-defined files are to be overwritten.

    Natural's user-defined files contain the following translation tables:

    ASC2(Ansi)EBCDICUser1
    ASC2(Ansi)EBCDICUser2
    ASC2(Ansi)EBCDICUser3
    ASC2(Ansi)EBCDICUser4
    EBCDICUser1(Ansi)2ASC
    EBCDICUser2(Ansi)2ASC
    EBCDICUser3(Ansi)2ASC
    EBCDICUser4(Ansi)2ASC

  9. So that a translation table can be used in Natural, it has to be specified in Natural Studio's workspace options. See Workspace Options in the documentation Using Natural Studio.

Adapting Translation Tables for Natural Development Server under BS2000

For the Natural Development Server under BS2000 the translation tables have to be adapted as follows:

ASC2EBCDIC

Position Value Character
C4 BB Ä
D6 BC Ö
DC BD Ü
DF FF ß
E4 FB ä
F6 4F ö
FC FD ü

EBCDIC2ASC

Position Value Character
BB C4 Ä
BC D6 Ö
BD DC Ü
FF DF ß
FB E4 ä
4F F6 ö
FD FC ü

Correcting a Wrong Conversion

This example tells you what you can do if the backslash (\), which is a special character, is not converted correctly in the file N3270_USER1.tra.

Start of instruction setTo correct a wrong conversion

  1. Make a backup of the file N3270_USER1.tra.

  2. Look up the hexadecimal values for the backslash character. The following values are used in this example:

    • The number of the code page on the PC is 850. In this code page, the backslash is defined as "5C".

    • The number of the code page on the host is 273. In this code page, the backslash is defined as "EC".

  3. Edit the file N3270_USER1.tra.

  4. Go to row 05 and column 0C in table ASC2(Ansi)EBCDICGR.

  5. Enter the hexadecimal value for the host which is "EC".

  6. Go to row 0E and column 0C in table EBCDICGR(Ansi)2ASC.

  7. Enter the hexadecimal value for the PC which is "5C".

  8. Save the file N3270_USER1.tra.

  9. Import the changed file N3270_USER1.tra.