Chapter 2 - Using 3270/SNA Advanced Features
Users who need more control over how their PC participates in 3270/SNA terminal emulation can take advantage of the following features:
Using the 3270/SNA resident emulation program Capturing print data on disk Customizing the PC keyboard Using adapter files Entering emulation from the DOS command line
The sections that follow describe each of these features.
Using the Resident Emulation Program
To exit from emulation and hold sessions, you must control how the 3270/SNA programs run in your PC. For example, file transfer programs may require that you be at the DOS prompt while still in session with the host.
To achieve this goal, you make 3270/SNA resident in the memory of your PC. Depending on how you make 3270/SNA resident, you can return to emulation in the same session with the host by using VINES menus, the 3270 command, or a special hotkey.
This section explains how to use the memory-resident features of 3270/SNA. Topics discussed are as follows:
How the Parts of 3270/SNA Work
To use 3270/SNA as a resident program, you must understand how the different elements of 3270/SNA work together in the PC, and how to control them.
On the PC, 3270/SNA consists of three programs that work together to provide you with terminal emulation. They are described in the next three sections.
I3270
I3270 reads your user profile and processes any 3270 commands that you issue. It initializes your emulation environment, setting up what logical units you use, what keyboard definitions are in effect, and so on. It then leaves PC memory. If you issue I3270 as a command from DOS, it accepts the same switches and parameters as the 3270 command. For details on that command, see the later section, "Entering Emulation from DOS."
When using the I3270 command to set up multiple host sessions, you must specify the switches in the following order:
1. /LU:n.
2. Either /CLU:n or /PLU:n.
3. /CLU2:n.
4. /CLU3:n.
Otherwise, you receive only one display session.
R3270
R3270 supports a programmatic interface. It can be used by file transfer programs to transfer files between the host computer and the user's PC. You can make this program resident if you load it from DOS with the R3270 command before the PC enters emulation.
T3270
T3270 performs screen handling and other PC-related tasks during emulation. You can make this program resident if you explicitly load it from DOS with the /res switch. When you choose a 3270/SNA service from a menu, or issue a 3270 command, all three programs run. First, a check is made to see if R3270 is already in the PC memory; if not, it is loaded. I3270 runs next, and initializes the environment as explained above. T3270 is then loaded into memory, and remains resident along with R3270 until you exit from emulation.
Returning to Emulation through Menus or at DOS
To hold sessions that you can enter and exit from VINES menus or the 3270 command, you must make R3270 resident in the PC before you enter emulation. If R3270 is not made resident, you have no option to leave emulation and hold sessions. All 3270/SNA programs leave PC memory when you exit from emulation.
To make R3270 resident, enter R3270 from the DOS prompt or from a batch file. To leave emulation with sessions held, choose that function from the Command Menu, as explained in Chapter 1. You return to the DOS prompt.
Once R3270 is resident, you don't have to log in to the host computer when you return to 3270/SNA terminal emulation. You also can use file transfer programs to transfer files between PCs and the host computer. To return to emulation, use the Select a Connection menu or issue a 3270 command.
R3270 uses space in memory that may be required by other programs. To release the program from memory, use REL3270 if R3270 was the last resident program loaded into memory. Keep in mind that exiting from emulation does not release memory.
Note: If you try to release R3270 and it was not the last resident program loaded into memory, DOS may try to use the released space incorrectly. Then, you must reboot or turn off the PC and begin again.
Returning to Emulation by Using a Hotkey
You can make 3270/SNA resident so that you can exit from and re-enter emulation by using a hotkey.
A hotkey is a special, predefined key that switches your PC from one program to another. For example, if the hotkey is <Alt-Z>, you press <Alt-Z> while in emulation and return immediately to the DOS prompt with sessions held. From DOS or from an application that doesn't use graphics, you press <Alt-Z> to enter, or return to, your emulation session. No menus or other commands are required to enter or leave emulation.
To invoke this feature, you must run the three 3270/SNA programs at the PC, as follows:
1. First, run R3270 to load R3270 and make it resident.
2. Next, run I3270. You can provide switches on the command, using the same ones supported by 3270. For details, see the later section, "Entering Emulation from DOS."
The default hotkey is <Alt-Z>. To use another key, create a keyboard definitions file with KB3270 and change the mapping for the hotkey. Then, load the keyboard file with the /KEYBOARD switch on the I3270 command. For complete instructions, see the section "Customizing the PC Keyboard."
3. Finally, run T3270 /res. This command loads the T3270 program, and makes it resident in the PC.
You can issue the three commands from DOS, or from a batch file. Issue them in the order specified above. The first time you press the hotkey while in emulation, you return to DOS, but both R3270 and T3270 remain in PC memory. You can then return to emulation by pressing the hotkey from DOS, or from any application that does not put the screen into a graphics mode. If you press the hotkey from an application, you will return to that application the next time you press the hotkey.
You also can exit using the VINES menus, holding or releasing sessions as desired. Again, both R3270 and T3270 remain in PC memory. To return to emulation, issue an I3270 or 3270 command, or use the VINES menus. Do not rerun a hotkey batch file or attempt to reload resident R3270 or T3270.
Controlling How Much PC Memory 3270/SNA Uses
An individual PC may have memory limitations that affect how 3270/SNA operates. If you need to, you can limit the memory used by 3270/SNA.
To limit the amount of memory used by R3270, use the /NUMLUS:n switch. This switch specifies how many bytes of memory the program can use. If you issue the R3270 command without this switch, R3270 takes up the amount of memory required for 4 LUs.
Each LU uses 5K bytes of memory. If you know that you will engage in only one session at a time, and you need to free up some PC memory, you can issue this command:
R3270 /numlus:1
To use this feature, you must issue the R3270 command directly from DOS or from a batch file. It works whether you provide held sessions from a menu, or with a hotkey. Note that specifying this switch limits the number of sessions that can be requested by any subsequent 3270 commands.
You can capture print data from the mainframe into a DOS file during terminal emulation. To use Disk Capture, press <F3> at the Command Menu. The Disk Capture screen is displayed, as shown in Figure 2-1.
To activate or deactivate disk capture, enter Yor N at the prompt: Activate disk capture? The default is N.
If you activate disk capture, you must specify the name of the file in which you want your data saved.
The editing keys work as follows:
The <ENTER> key toggles between the two fields. In the filename field, the <BACKSPACE> and <LEFT ARROW> keys erase one character immediately to the left of the cursor. Figure 2-1. Disk Capture of Print Data Screen
To use the screen, turn disk capture on or off as needed. Provide a file name. To save your changes, press <F10>. To exit without saving the changes, press <ESC>.
When you select Disk Capture, these actions occur:
3270/SNA attempts to open the named file. If successful, any new data sent to the file is appended to existing data. If the file doesn't exist, a new file is created with the specified name. Any file previously opened for Disk Capture is closed. If the named file can't be made ready for data, you get an error message. The selection and filename fields are restored to their original content. At this point, you can try again.
Once Disk Capture is active, any data that would normally go to a printer is redirected to the named file. The file can be located on any available drive. To deactivate Disk Capture, press <F3> at the Command Menu and enter N in the selection field.
Print data can originate from the COPY command, or from data sent by the host application directly to the printer device. By default, 3270/SNA uses a page length of 66 and a maximum print position (line length) of 132.
By using an adapter file, you can turn disk capture on automatically when you enter emulation. You also can set up a file name for disk capture, and override the default page and line length, by including appropriate information in the file. See the later section, "Using Adapter Files," for details.
For your PC keyboard, you can modify the function key and international character definitions for using the KB3270 program. This program produces a DOS file that contains your modified keyboard definitions.
To run this program, enter KB3270 at the DOS prompt. The 3270 Definitions menu is displayed, as shown in Figure 2-2.
Note that for a 3270/PC, the only function key you should change is the hotkey. You can change any of the international character definitions.
The sections that follow explain how to use each of the options on the 3270 Definitions menu.
Reading in a 3270 Key Definitions File
To make changes to an existing 3270 key definitions file using KB3270, follow these steps:
1. From the 3270 Definitions menu, select the READ 3270 Definitions File option.
2. Enter the name of the file you want. The file name can include a directory pathname and an extension.
3. Press <F10> to read in the file.
The definitions in that file will appear on all the other screens that the program presents. You can then make changes, and save the file with the same name or another name.
Changing 3270 Function Key Definitions
To change the keyboard definition of any of the 3270 function keys, choose the function, Change 3270 Function Key Definitions on the 3270 Definitions menu. The 3270 Function Key Definitions menu appears, as shown in Figure 2-3.
Note that on the screen, a-F5 means press the <ALT> key and the <F5> key simultaneously; c-G means press the <CTRL> key and the G key simultaneously; and so forth.
To change a function key definition, perform these steps:
1. Select the CHANGE function. Position the highlight on the function key you wish to change, and press <ENTER>.
2. At the next screen, press the new key that you chose for the 3270 function and press <ENTER>. Be sure to press the exact key combination you want to use. For example, to get <ALT-F9>, press <F9> while holding down the <ALT> key. The screen displays a-F9.
Continue in this manner for each key definition you want to change. Then, you must save these changes in a file. Refer to the section, "Saving Changes to 3270 Key Definitions."
Customizing International Characters
To control how your PC displays international characters and sends them to the host, choose the function, Customize International Character Mappings from the 3270 Definitions menu. The menu shown in Figure 2-4 appears.
You can customize the keystroke and the graphics character for any of the 14 characters in the 3270 international character set. The sections that follow explain how to use these functions.
Changing a Keystroke for an EBCDIC Mapping
To change the keystroke of an EBCDIC mapping, perform these steps:
1. Choose the Change Keystroke to EBCDIC Mappings function.
2. Highlight the EBCDIC mapping you wish to change and press <ENTER>.
3. Type in the new keystroke for the mapping. The Customizing Character Mappings screen is redisplayed with your change in effect.
Continue in this manner until you make all changes. Then, you must save the changes in a file. Refer to the section, "Saving Changes to 3270 Key Definitions."
Changing a Display for an EBCDIC Mapping
To change the display of an EBCDIC mapping, perform these steps:
1. Choose the Change EBCDIC to Display Mappings function.
2. Highlight the EBCDIC mapping you wish to change and press <ENTER>.
3. At the next screen, highlight a hexadecimal graphics character to be displayed for the EBCDIC mapping and press <ENTER>. The Customizing Character Mappings screen is redisplayed with the new display character for the EBCDIC mapping.
Continue in this manner until you make all changes. Then, you must save the changes in a file. Refer to the section below, "Saving Changes to 3270 Key Definitions."
Saving Changes to 3270 Key Definition
To save the changes you made to 3270 key definitions, you must write the changes to a file. That file can then be loaded for your use when you enter 3270 emulation. Proceed as follows:
1. Press <ESC> to return to the 3270 Definitions Menu.
2. Select the SAVE 3270 Definitions File option.
3. Enter the name of the file in which you want to save your changes. The file name can include a directory pathname and an extension. Use a file name that is easy to identify.
4. Press <F10> to save the file.
To use a KB3270 definitions file, use the /KEYBOARD switch on the 3270 or I3270 command to load the file from DOS. Your system administrator can also modify your user profile so that a KB3270 definitions file is used whenever you enter 3270/SNA emulation. For examples, see the section later on, "Entering Emulation from DOS."
3270/SNA allows you to create a special DOS file, called an adapter file, and load the file when you enter emulation. An adapter file controls these aspects of how your PC operates during emulation:
What parameters are used for capturing print data to disk. Whether the status line shows text or symbols. How the PC displays extended attributes sent by the host.
To use these features, enter GA3270 at the DOS prompt. The 3270 Adapter Configuration menu appears, as shown in Figure 2-5.
You select functions from the menu to control how your PC operates during emulation. You then save your settings into a file. To use the file, load it with the /ADAPTER switch on a 3270 or I3270 command. The file applies to all concurrent sessions during emulation.
The sections that follow present information on these topics:
Recommendations for using adapter files Reading in an adapter file Setting up the printer Controlling display of the status line Customizing PC display attributes Saving changes to an adapter file
Recommendations for Using Adapter Files
You must create a file with GA3270 if you want to perform printer setup, or control how the status line displays. Whether you should use the program for controlling PC display of extended attributes depends on the adapter installed in a given PC and the applications you are running, as discussed in the paragraphs that follow.
Each character displayed on the PC during emulation has an associated color and highlighting attribute. Some applications use these colors and attributes to differentiate types of data.
Depending on the adapter in the PC, 3270/SNA uses defaults for how these colors and attributes are displayed. You can accept the defaults in one of two ways: not using an adapter file, or using an adapter file that defaults to the PC attributes.
Unless you use an adapter file to specify otherwise, 3270/SNA assumes that all color displays are CGA.
You may use an application and find that the defaults are unsatisfactory. If so, you can customize the display of data on the PC during emulation. You do this by changing the extended attribute and control attribute assignments for the PC.
The extended attribute and control attribute assignments are hexadecimal numbers that are used to translate host color/attribute pairs into PC colors. PC colors can have their own special features such as blinking, underlining, or reverse video. To find out what hexadecimal codes your PC uses, consult the technical reference manual for your adapter or PC.
For monochrome PCs, accept the default mappings, then test your applications. If there are problems with an application, use GA3270 to change the attribute assignments.
For CGA displays, accept the default mappings, then test your applications. If there are problems with an application, use GA3270 to change the attribute assignments. Note that CGA does not support underlining and has limited capacity for reverse video.
For EGA and VGA displays, use an adapter file to obtain full capability from the Host Session Adapter. Use an adapter file that selects EGA or VGA, with the defaults provided by GA3270. Then, test your applications. If there are problems with an application, use GA3270 to change the attribute assignments. You also can change the palette registers called by the attributes.
For 3270/PCs, use an adapter file to obtain full capability from the Host Session Adapter. Use an adapter file that selects that adapter with the GA3270 defaults, then test your applications. If you encounter problems with an application, use GA3270 to change the attribute assignments. You can't use the file with the 3270/PC Host Control Program
To make changes to an existing adapter file using GA3270, perform these steps:
1. From the 3270 Adapter Configuration menu, select the READ Previous Adapter Assignments File option.
2. Enter the name of the file you want. The file name can include a directory pathname and an extension.
3. Press <F10> to read in the file.
The parameters and attributes in the file will appear on all screens the program presents. You then can make changes and save the file using the same name or another name.
To control how printing will work during emulation, choose the function, MODIFY Printer Configuration from the 3270 Adapter Configuration menu. The 3270 Printer Definition Screen appears:
Enter the following information on this screen:
Page Length. How many lines there should be on each printed page.
Maximum Print Position. How long each printed line should be.
Printer Port Number. Whether printed output should go to PC printer port LPT1, LPT2, or LPT3. This port can be a local PC printer or a VINES network printer. Setting this port number has the same effect as specifying the /PRINTER switch on a 3270 command.
Redirection File Name. The name of the DOS file to which captured print data is directed. You can include a pathname if desired. For more information, see the earlier section, "Capturing Print Data on Disk."
If you enter a file name, your PC will automatically capture print data to disk when you enter emulation. You then can control disk capture from the Command Menu.
To set up the printer, proceed as follows:
1. Type in a value for each field you want to change. You can use the arrow keys to move the cursor, or press <ENTER> to move from one field to another.
2. When you have finished entering information, press <F10> or <ENTER> with the cursor on the file name. You return to the 3270 Adapter Configuration menu.
Values you enter on this screen go into effect if you save them in an adapter file, then enter emulation using that file.
Controlling Display of the Status Line
To control how status messages will appear on the status line during emulation, choose the function, MODIFY Status Line Assignment, from the 3270 Adapter Configuration menu. A menu appears, allowing you to choose between text display or display of symbols. Text is the default.
Use the arrow keys to move the cursor between text and symbol displays. Press <ENTER> to select your choice. You return to the 3270 Adapter Configuration menu.
Customizing PC Display Attributes
If you have special requirements for how host attributes appear on the PC, you can take advantage of these features:
Choosing an adapter type. Choosing control attributes for the status line and menus. Choosing extended attributes for highlighting, including palette registers for EGA and VGA.
To use these features, you should understand the issues in the earlier section, "Recommendations for Using Adapter Files."
Choosing an Adapter
To choose a specific adapter type for your PC during emulation, choose the function, MODIFY Adapter Type, from the 3270 Adapter Configuration menu. The 3270 Adapter Assignments menu appears, as shown in Figure 2-7.
To choose an adapter, perform these steps:
1. Use the arrow keys to move the cursor. When the adapter you want is highlighted, press <ENTER>.
2. A prompt appears, asking if you want to default all of the control attributes and the extended attributes.
If you choose NO , all of the attributes are set to zeros. NO is the default choice.
If you choose YES , the attributes are set to defaults. These defaults approximate the 3270 extended attributes, using the colors or other characteristics of the adapter you chose.
3. Move the cursor to your choice, YES or NO. Press <ENTER>. If you choose an adapter other than EGA or VGA, you return to the 3270 Adapter Configuration menu.
If you choose an EGA or a VGA adapter, you are prompted for additional information. See the next section for details.
The attributes you chose, either zeros or defaults, appear on the Control Attribute Assignments and the Extended Attributes menus. To examine or change them, see the later sections, "Choosing Control Attributes" and "Choosing Extended Attributes."
Defining an EGA or a VGA Adapter
If you choose an EGA or a VGA adapter and you do not accept the default attributes, a prompt appears to help you configure the adapter. You can specify the following:
Do you want to use underscore? Specify YES if you want a font loaded during emulation so the adapter can display underscoring. Specify NO if you do not want the font loaded.
Do you want to load palette registers? Specify YES if you want to set the contents of EGA or VGA palette registers. Specify NO if you do not.
When you have finished, press <F10>, or press <ENTER> at the last prompt.
If you choose YES for loading palette registers, the 3270 Palette Register Assignments screen appears. Figure 2-8 shows that screen for EGA.
Palette registers provide the adapter codes for color and intensity. These codes translate extended attributes sent by the host. The control attributes and extended attributes configured for the adapter refer to the contents of these registers.
To set the contents of a register, perform these steps:
1. Use the arrow keys to move the cursor. Press <ENTER> when the register you want is highlighted.
2. Enter the hexadecimal code for the attribute you want displayed. You return to the 3270 Palette Register Assignments Menu.
Repeat steps 1 and 2 until you have finished. To save your changes, press <F10>. To leave the screen without saving your changes, press <ESC>. In either case, you return to the 3270 Adapter Configuration menu.
To choose control attributes for your PC during emulation, choose the function, MODIFY Control Attribute Assignments, from the 3270 Adapter Configuration menu. The 3270 Control Attribute Assignments screen appears, as shown in Figure 2-9.
The two attributes set the characteristics of the 3270 status line and the VINES command screens that appear during emulation.
To set the control attributes, perform these steps:
1. Use the arrow keys to move the cursor. Press <ENTER> when the attribute you want to change is highlighted.
2. Enter the proper hexadecimal code for the attribute you want displayed. You return to the 3270 Control Attribute Assignments menu.
Repeat steps 1 and 2 until you have finished. To save your changes, press <F10>. To leave the screen without saving your changes, press <ESC>. In either case, you return to the 3270 Adapter Configuration menu.
To choose extended attributes for your PC during emulation, choose the function, MODIFY Extended Attribute Assignments, from the 3270 Adapter Configuration menu. The 3270 Extended Attributes screen appears, as shown in Figure 2-10.
The screen shows all the colors that the host can send. Next to each color are the extended attributes, such as normal or underscore, that can be associated with each color. The columns of hexadecimal numbers tell the PC which color to display when it receives a color and attribute from the host.
To set the extended attributes, perform these steps:
1. Use the arrow keys to move the cursor. Press <ENTER> when the extended attribute you want to change is highlighted.
2. Enter the proper hexadecimal code for the PC color you want displayed. You return to the 3270 Extended Attribute Assignments menu.
3. Repeat steps 1 and 2 until you have completed all your changes.
To save your changes, press <F10> when you have finished. To leave the screen without saving your changes, press <ESC>. In either case, you return to the 3270 Adapter Configuration Menu.
Saving Changes to an Adapter File
To save the changes you made to attributes or other settings, you must write the changes to a file. That file then can be loaded for your use when you enter 3270 emulation.
Proceed as follows:
1. Press <ESC> to return to the 3270 Adapter Configuration menu.
2. Select the SAVE Adapter Assignments File option.
3. Enter the name of the file in which you want to save your changes. The file name can include a directory pathname and an extension. Use a file name that is easy to identify.
4. Press <F10> to save the file.
To use an adapter file, you use the /ADAPTER switch on the 3270 or I3270 command to load the file from DOS. Your system administrator can modify your user profile so that an adapter file is used whenever you enter 3270/SNA emulation. For examples, see the next section, "Entering Emulation from DOS."
You can enter 3270/SNA terminal emulation directly from the DOS prompt by issuing the 3270 command. This command allows you to use 3270/SNA services that do not appear in your user profile.
Note that any parameters provided by a 3270 command that is issued from DOS override parameters in your profile. Parameters omitted from the 3270 command use the values set in your profile.
The syntax of 3270 is as follows:
3270 [service-name@group@org] [/LU:n]
[/PLU:specifier] [/PRINTER:LPTn]
[/CLU:n][/CLU2:n][/CLU3:n]
[/KEYBOARD:filespec] [/ADAPTER:filespec]
When using 3270 to set up multiple host sessions, you must specify the switches in the following order:
1. /LU:n.
2. Either /CLU:n or /PLU:n.
3. /CLU2:n.
4. /CLU3:n.
Otherwise, you receive only one display session.
The parameters that are used with the command are discussed in the paragraphs that follow. Note the use of all logical units, both display and print, is subject to any access rights set by your system administrator.
service-name@group@org is a StreetTalk name for a 3270/SNA emulation service. If you don't specify this parameter, your administrator must specify a service in your user profile.
/LU:number is the number, from 2 to 33, of a display logical unit. If this logical unit is not in use, the system will attach it to your PC. If it is in use, the PC cannot act as a terminal unless you issue this command again with a different number. If you don't specify a number, the service tries to find an available LU that you can access.
/PLU:specifier identifies the PC as a printer logical unit. The specifier can be a number from 2 to 33, the word NEXT, or a blank. This switch provides a print session with the host.
If you specify NEXT, the 3270/SNA service attaches to the logical unit that is one greater than the display logical unit. If you're going to use NEXT, be sure that every other logical unit is a printer. For example, if logical unit #2 is a display, then #3 should be a printer; if #4 is a display, #5 should be a printer, and so on.
If you don't specify a number or NEXT, 3270/SNA terminal emulation attaches to the next available printer logical unit.
/PRINTER:LPTn is the number of the printer port on the PC to be used for the print session specified by the previous switch. It can be 1, 2, or 3. This value can also be set by an adapter file.
/CLU:n, /CLU2:n, and /CLU3:n provide additional display sessions while in 3270 emulation. The optional n specifies the number of a display logical unit. If you omit n, the next available one is used.
If you specify the /PLU switch, you can use only two of these additional sessions. Entering emulation automatically provides one display session. Each PC can have a maximum of four total sessions: four display sessions, or three display sessions and one print session.
/KEYBOARD:filespec indicates that a keyboard definitions file should be used in 3270 emulation. filespec is a valid DOS file specification that names a file created by the KB3270 program. If you do not specify a keyboard file, the default mappings shown in Table 5-1 are used.
/ADAPTER:filespec indicates that an adapter file should be used in 3270 emulation. filespec is a valid DOS file specification that names a file created by GA3270 program. If you do not specify an adapter file, defaults for monochrome or CGA display are used.
Here are some examples of issuing the 3270 command from DOS:
3270
puts you in emulation, using the service and any other settings in the user profile.
3270 ibmsna@production@manufacturing /clu
puts you in emulation, using the specified service and any two available display LUs.
3270 /keyboard:uk.kbd /adapter:ega.gdf
puts you in emulation, using the service in your profile, any available display LU, keyboard mappings from the file uk.kbd, and display attributes from the file ega.gdf.