This chapter describes special BARR/RJE applications. You will learn how to convert data between the ASCII and EBCDIC character set during serial port input, transfer files from PC to PC, package BARR/RJE inside an application, and assume the host communication role.
The Barr software converts data between the ASCII and EBCDIC character sets when you input jobs from the PC serial ports (COM1 to COM4) and direct them to the mainframe reader (RD1).
To input jobs on a COM port, you must enable the COM port as a source device on the Installation Description’s Devices and Printers screen. Under Assign Devices, you can assign sources COM1 to COM4 to any destination, including the host reader devices (RD1 to RD4). See section 8.4, COM1-COM4 Devices, for more information about setting up COM ports as data sources. See Chapter 10 for more information about assigning devices.
You can use ASCII-to-EBCDIC conversions for these types of applications:
Inputting files from a VAX and sending them to an IBM mainframe.
Inputting files from a Hewlett-Packard minicomputer and sending them to an IBM mainframe.
Inputting data every 20 minutes from the telephone company’s Automatic Call Distributing Unit (ACDU).
Uploading information from a Cardamation 600-card-per-minute reader.
Connecting a MICOM port selector with up to seven attached PCs to BARR/RJE. Then inputting jobs from the other PCs via the MICOM and sending the jobs to the host system.
Follow these steps to set up protocol conversion:
From the RJE Description screen, specify the number of readers and printers:
Printers:
2 (max 7)
Punches: 1 (max 4)
Readers: 2 (max 4)
From the Serial Port Options screen under Devices and Printers, set the baud rate of the serial port to the serial line’s required value.
The file can be preceded by a string of characters (called a Serial Port Input Header) to form it into a job for the host operating system. Enter these characters on the Printer Control Data screen. Section 8.8, Printer Control Data, includes an example of the Serial Port Input Header.
From the Assign Devices screen, assign COM1 to RD2 (COM1RD2).
Send the files from a VAX or other device. A Ctrl-Z (hexadecimal 1A) indicates the end of each file input from a serial device.
If the first character read from the serial port is a backslash (\), the data line will be sent as a command to the host. You can terminate the command with a carriage return or Ctrl-Z.
Test Mode: To test input from the serial port, use Test mode. From the Tuning and Global Options, Trace and Memory Options screen, set Test mode to Yes. In test mode, RD1 is sent to PR1 and RD2 returns on PR2. If you assign PR2 to the SCREEN, the input from the serial port appears on your screen.
A PC with BARR/RJE can send exact copies of files to another PC that uses BARR/RJE. You can transfer various types of files, including Lotus files, word-processing files, and program files in .EXE and .COM format. You can connect by PC-to-PC dial-up or through the JES network.
A PC can transfer files to another PC through a dial-up connection. You should configure one PC as Host and the other as Remote. See section 18.4, Tuning and Global Options, Modem and Line Control.
From the BARR/RJE Operation screen on both PCs:
Select Advanced.
Select Assign Devices.
Select PR1 as the source device.
Select (FILE) as the destination to assign PR1 to disk.
Type the name of the directory followed by a backslash ( \ ) in the Beginning of filename field.
Select Receive mode.
Select Transfer files.
Press ESC twice to return to the Operation screen.
BARR/RJE must be running on both PC 1 and PC 2. Follow these steps for a manual dial connection:
With both modems set to Talk, the PC 1 operator calls the modem number of PC 2.
The PC 2 operator answers the telephone.
Both operators change modem settings from Talk to Normal and hang up the telephones.
When the PCs connect, the word BARR appears in large letters on both PCs. The operators can still communicate from the console.
Both operators can send files independently from the Operation screen. Follow file names with the /TB send mode to send files in Transfer Binary format.
Select Send Files to RD1.
Type filename/TB.
A JES2 communications network can transfer files between PCs with BARR/RJE. The sender of the file must specify the remote name of the receiver. The sending and receiving BARR/RJE program configurations must be identical.
To configure BARR/RJE for a JES2 network transfer, follow these steps from the BARR/RJE Operation screen:
Select Advanced.
Select Assign Devices.
Select PU1 as the source device.
Select (FILE) as the destination to assign PU1 to disk.
Type the name of the directory followed by a backslash ( \ ).
Select Receive mode.
Select Transfer files.
Press ESC twice to return to the Operation screen.
The following example shows you an efficient way to transfer files. The example sends a file from Remote 20 to Remote 99.
Create a file named RMT99 with the following information:
//RMT99
JOB account,programmer,TYPRUN=COPY,MSGCLASS=B
/*ROUTE PUNCH RMT99
The account and programmer parameters are your account number and name. The JES2 TYPRUN=COPY feature takes an input job and immediately copies it to the output queue. MSGCLASS=B indicates that the JCL output will be marked as PUNCH output. The /*ROUTE statement specifies that the PUNCH output will be sent to RMT99. The word PUNCH starts in column 10 and RMT99 starts in column 16.
From the BARR/RJE Operation screen:
Select Send Files.
Type RMT99+filename/TB.
You can package BARR/RJE in an application program so users do not see BARR/RJE operation details (for example, in data entry environments).
This process occurs when you package BARR/RJE in an application program:
Your data entry program collects data into files.
The application program calls BARR/RJE and specifies files to send to the mainframe.
BARR/RJE uses a modem to autodial the mainframe.
BARR/RJE sends files to the mainframe and receives printouts on the PC.
BARR/RJE disconnects and exits to the program that called it when it finishes sending files and receiving printouts.
The application program can terminate or continue with other tasks.
Change your application program code as described in this section.
You can implement the packaging structure by using batch files or the SHELL construct in the BASIC, PASCAL, C, or COBOL computer languages. Enter the following command in your program:
barrsnar files
In this command, files represents the names of the files to send to the mainframe.
To cause BARR/RJE to exit after it sends and receives files, access Tuning and Global Options, Restart Actions from the Installation Description screen and make the following selections:
In your batch file, you can test the value of the DOS ERRORLEVEL parameter and specify an appropriate action.
BARR/RJE sets the ERRORLEVEL as defined in DOS. If BARR/RJE completes its task, it sets the ERRORLEVEL to 0. If the transfer does not complete normally, it sets the ERRORLEVEL to 15. (See the IF statement under Batch Commands in your DOS manual.)
For example, if the transfer completes normally, you can instruct DOS to delete the PC file as in the following example:
BARRSNAR FILE.DAT
IF NOT ERRORLEVEL 15 ERASE FILE.DAT
BARR/RJE can assume either the remote or the host communication role. Set BARR/RJE’s communication role from the Tuning and Global Options, Modem and Line Control screen.
If you set the communication role to host mode, commands you enter on your keyboard appear on the remote’s screen. When BARR/RJE operates as the host, it communicates with any SNA remote, including these older remote systems:
Harris Corporation’s Harris 1610
Datapoint Corporation’s Datapoint 1800
IBM Corporation’s IBM 3777-3
You can use host mode to copy punch decks to files on the PC. You can also use an older SNA workstation with a card reader to send the punch decks to the PC running BARR/RJE by assigning PR1(FILE). Files sent from either the host or remote appear on PR1 of the receiving system. Any form feed characters for new pages are converted to the skip-to-channel-1 character.
The following example illustrates the correspondence between the host and remote devices.
Use any of these procedures to establish data communication:
Remote and host operators establish voice contact by telephone. Both operators then switch their modems from Talk to Normal.
One site sets its modem to autoanswer. The operator on the other terminal makes the call. When the modem answers with a high-pitched sound, the operator sets the modem from Talk to Normal.
Use a synchronous modem eliminator (SME) cable to connect directly to the mainframe as described in the Barr adapter manual. You can order an SME cable from Barr Systems.