BARR/RJE manual

26. Special Applications

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.


26.1 Converting Data for Serial Port Input

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.

Types of Applications

You can use ASCII-to-EBCDIC conversions for these types of applications:

Conversion Steps

Follow these steps to set up protocol conversion:

  1. From the RJE Description screen, specify the number of readers and printers:

Printers: 2 (max 7)
Punches: 1 (max 4)

Readers: 2 (max 4)

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

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

  3. From the Assign Devices screen, assign COM1 to RD2 (COM1RD2).

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

26.2 Transferring Files from PC to PC

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.

File Transfer by Dial-Up Connection

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.

Configure BARR/RJE

From the BARR/RJE Operation screen on both PCs:

  1. Select Advanced.

  2. Select Assign Devices.

  3. Select PR1 as the source device.

  4. Select (FILE) as the destination to assign PR1 to disk.

  5. Type the name of the directory followed by a backslash ( \ ) in the Beginning of filename field.

  6. Select Receive mode.

  7. Select Transfer files.

  8. Press ESC twice to return to the Operation screen.

Connect by Telephone

BARR/RJE must be running on both PC 1 and PC 2. Follow these steps for a manual dial connection:

  1. With both modems set to Talk, the PC 1 operator calls the modem number of PC 2.

  2. The PC 2 operator answers the telephone.

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

Send Files

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.

  1. Select Send Files to RD1.

  2. Type filename/TB.

File Transfer through the JES2 Network

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.

Configure BARR/RJE for JES2 Network Transfer

To configure BARR/RJE for a JES2 network transfer, follow these steps from the BARR/RJE Operation screen:

  1. Select Advanced.

  2. Select Assign Devices.

  3. Select PU1 as the source device.

  4. Select (FILE) as the destination to assign PU1 to disk.

  5. Type the name of the directory followed by a backslash ( \ ).

  6. Select Receive mode.

  7. Select Transfer files.

  8. Press ESC twice to return to the Operation screen.

File Transfer Example

The following example shows you an efficient way to transfer files. The example sends a file from Remote 20 to Remote 99.

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

  1. Select Send Files.

  2. Type RMT99+filename/TB.

26.3 Packaging BARR/RJE in an Application

You can package BARR/RJE in an application program so users do not see BARR/RJE operation details (for example, in data entry environments).

Packaging BARR/RJE

This process occurs when you package BARR/RJE in an application program:

  1. Your data entry program collects data into files.

  2. The application program calls BARR/RJE and specifies files to send to the mainframe.

  3. BARR/RJE uses a modem to autodial the mainframe.

  4. BARR/RJE sends files to the mainframe and receives printouts on the PC.

  5. BARR/RJE disconnects and exits to the program that called it when it finishes sending files and receiving printouts.

  6. The application program can terminate or continue with other tasks.

Changing Your Application Program Code

Change your application program code as described in this section.

Batch/SHELL

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.

Exit

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:

ERRORLEVEL

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

26.4 Assuming the Host Communication Role

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:

When to Use Host Mode

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.

How to Connect the Host and Remote

Use any of these procedures to establish data communication: