KERMIT for UNISYS A-Series Systems October 1989 Authors: Larry Johnson, Katie Stevens, Dave Squire University of California, Davis Language: Algol Version: 1.041 Date: September 28, 1989 A-Series KERMIT Capabilities At a Glance: Local operation: No Remote operation: Yes Transfers text files: Yes Transfers binary files: Yes Wildcard send: No Filename collision avoidance: No Timeouts: Yes 8-th bit prefixing: Yes Repeat count prefixing: Yes Alternate block check types: Yes Transaction logging: No Session logging: No Debug logging: Yes Act as server: Yes Advanced server functions: No Command/init files: Yes Attribute packets: No Long Packets: Yes Windowing: No Kermit is a program that does reliable file transfer between computers over data communication lines and has been implemented on many different machines, including microprocessors. AS-Kermit, written in Algol for Unisys A-series systems, communicates with even the most minimal Kermit implementations. The program source is contained in one symbol file and does not require a separate help file. The program does not require any special datacom support. The file transfer protocol uses packets that are checksummed and acknowledged, and are resent if errors are detected. Packet lengths are typically limited to 88 characters of data although this version allows longer packet sizes to be specified. In the narrative description that follows, there are several references to AS-Kermit commands. These commands are all described in detail in the final section of this document. Since one Kermit does not a file transfer make, it is assumed that the reader is familiar with at least one other implementation of Kermit, namely the version that runs on the system communicating with AS-Kermit on the A-series machine. UNISYS File System For Kermit users, the most important features of the Unisys A- Series file system are character set, file title and file structure. Since AS-Kermit must be able to transfer files to and from a large variety of operating systems there are commands to allow users to control these attributes. Character Set Conversion The default character set of an A-Series file is EBCDIC. Since most micros and many other systems use ASCII, it is necessary for AS-Kermit to translate between these character sets. When receiving a file, characters are unconditionally translated from ASCII to EBCDIC. When sending a file, AS-Kermit uses the EXTMODE of the file to control translation. If the file is already ASCII then translation does not occur, otherwise an EBCDIC file is translated to ASCII. This translation is not important if the file being transferred is a text file, but since the conversion changes the bit patterns of each byte, problems arise when the file contains binary data. The SET BINARY command is used to preserve a full eight bit binary byte across the seven bit data path assumed by AS-Kermit. File Title Conversion Since A-Series file titles are generally incompatible with other computer system file naming conventions, there are provisions for title conversion. When sending, AS-Kermit can change an A-Series file title into one more compatible with other systems; for receiving, almost any file name may be converted to a usable A- Series file title. The SET SEND ACTUAL-TITLE command may be used to suppress the default conversion of file titles that normally occurs when sending files. A-Series file titles are of the form: (USERCODE)NAME1/NAME2/.../NAMEX ON FAMILYNAME Up to 12 names, each containing up to 17 characters, may be specified. Most micros have file names of the form: namename.ext, where namename may be up to 8 characters long, and .ext is an optional name extension up to 3 characters long. If the default conversion occurs when sending, the filename sent is the name following the final slash in the A-series title (NAMEX in the example above). If the name following the slash is longer than 8 characters, a period is inserted after the eighth character and up to three more characters are used as the name extension. If the name is longer than 11 characters, it is truncated. The on-part is not sent and the usercode is removed from the file title regardless of the state of SEND ACTUAL-TITLE. A-Series file title: (USERCODE)NAME1/.../LONGERTHAN11 ON MYFAM Sent as: longerth.an1 Additionally, since AS-Kermit uses one or more blanks as a token delimiter, files may not be sent that have blanks as part of a quoted name, nor can an on-part be specified in a SEND command. To send a file from a named pack, that pack must be part of a FAMILY statement specified before running AS-Kermit. When receiving files, file name conversion is controlled by RECEIVE ACTUAL-TITLE. If this attribute is set, the only modification AS- Kermit makes is to translate all lowercase letters in the file title to uppercase. If the resulting name is not a valid A-Series filename the receive will fail. If this attribute is not set, AS- Kermit converts the name supplied by the sender into a title with the following rules: 1) Lower case is translated to upper case and extraneous slashes are deleted. 2) If a name is longer than 17 characters, it is broken up into multiple 17 (or fewer) character names separated by slashes. 3) Names that contain non-alphanumeric characters, including periods, are enclosed in quotes. 4) The new title can have no more than 12 names. Since slash is used as a name separator, about the only string that won't produce a valid A-Series title is one of all slashes. File sent as: /justabitlongerthan17/"a/"//"zT"/abc.ext A-series title: JUSTABITLONGERTHA/N17/"A/"/ZT/"ABC.EXT" Unless the A-Series site runs AS-Kermit as a privileged program, files can not be directed to another usercode. To specify a usercode and/or a named pack, RECEIVE ACTUAL-TITLE must be set and a valid A-Series title specified with the usercode in parentheses and/or the on-part following the name. File Structure Conversion The file system on an A-Series computer is based on fixed-length, blocked records. Some other systems also use this method, but many systems use variable-length records with a character such as a linefeed for a record separator. The SET FILE commands control the manner in which AS-Kermit converts between fixed and variable length file formats. For AS-Kermit to be able to open a disk file for sending, the file must have FILEORGANIZATION of NOTRESTRICTED, which is the default for disk files on an A-Series system. Sending Conversion The default for AS-Kermit is to convert from fixed-length to variable-length records and to insert the two character separator consisting of between records. After the possible translation to ASCII, variable-length records are made by stripping trailing blanks and characters less than blank off the end of the fixed-length record read from the disk file. SET FILE FIXED may be used to inhibit the stripping of these trailing characters. SET FILE RAW may be used to not only inhibit the stripping of characters but to also inhibit the insertion of record separators. Receiving Conversion When receiving a file, AS-Kermit creates a diskfile with the following defaults: MAXRECSIZE = 15, BLOCKSIZE = 420, UNITS = WORDS. The SET FILE commands may be used to change these attributes but they must remain compatible. If a warning about blocksize-recordsize incompatibility is given, the values must be corrected before receiving a file. AS-Kermit converts the received records to fixed length format disk file using the following rules: 1) Any occurance of a linefeed is used to end a record. If the record received is shorter than a disk file record, it is padded with trailing blanks. If the record received is longer than a disk record, it is split into two or more records, and the last one is padded with blanks if necessary. The linefeed is not included in the disk record. 2) Carriage returns are discarded. It is assumed that they are part of the record separator. 3) Tabs (HT) are converted to blanks. The tab positions are in 8-column fixed positions. When a tab is encountered, blanks are inserted in the disk record to move to the next tab position. The tab conversion can be disabled with SET FILE EXPAND-TABS OFF. In this case, the tab characters are written into the disk file. One other option exists for file reception. SET FILE RAW ON may be used to override the record and the character conversions mentioned above. The disk file generated on the A-Series system is then a byte-by-byte copy of the received file, translated to EBCDIC. Setting RAW ON also sets EXPAND-TABS OFF. Transfers fail if the sending Kermit tries to use the parity bit for data. The local Kermit should have its communication set up for 7-bit if there are non-graphic characters in the file to be transferred. With some Kermits, this can only be done by setting parity to "space". Files containing EBCDIC characters that translate into ASCII characters with a value greater than 127 cannot be sent by AS-Kermit unless BINARY is ON. Running AS-Kermit AS-Kermit must be run interactively, and only in remote mode. This means that AS-Kermit may not be used to call another computer. Instead, the local system communicating with the A-series machine must run its version of Kermit. The local Kermit's terminal emulator is then used to log-on to A-series Cande and to run AS- Kermit. Thus the user needs to be familiar with both AS-Kermit and the Kermit version running on the local system. The following discussion, from the point of view of a user running a local Kermit on a computer in communication with an A-series host, refers to the user's system the local system. The first step in any file transfer is to run Kermit on the local system. When beginning execution, most versions of Kermit load an optional initialization file and then prompt for a command. To talk to the A-Series system, the CONNECT command is entered in order to begin terminal emulation. The keyboard and screen of the local system then act as a terminal and the user connects to the A- series computer according to the method used at the particular site. This might consist of telling the local system modem to dial out, or if the local system is directly connected to a network switch, simply specifying the A-series host in response to a "request" prompt. Once connected, the user logs on to Cande and then runs AS-Kermit. At UC Davis, typing "KERMIT" begins this execution, after which an initialization file, if present, is read (see TAKE command). A prompt is then given to enter a command and file transfer may begin. To transfer from the A-Series, the command SEND followed by the filename is entered. The local Kermit must then be put in receive mode. For most PC Kermits, "CONTROL-[ c", that is, CONTROL (CTRL) and [ keys at the same time, then "c", escapes to command mode, from which RECEIVE is entered in order to start receiving the file. On a Macintosh, the FILE menu choice RECEIVE must be clicked. When the transfer finishes, the Macintosh returns to terminal mode. Other versons usually return to command mode from which a CONNECT command is needed to restart terminal emulation in order to again communicate with AS-Kermit and begin another transfer. To transfer a file to the A-series machine, the RECEIVE command is entered, then after returning to command mode on the local system a SEND is entered. If the files being sent to the A-Series system need different record or block sizes, then the appropriate AS- Kermit commands must be entered before receiving each file. Server Mode Server mode may be used to transfer several files in both directions. In this mode AS-Kermit takes commands from the other Kermit instead of the keyboard. Instead of using SEND or RECEIVE commands, the AS-Kermit SERVER command is used before going back to command mode on the local Kermit. The SEND command is used on the local Kermit to transfer files to the A-Series system but the GET command is used from the local Kermit to transfer files from the A- Series system. This method saves having to go back and forth between the two Kermits to transfer files. The FINISH command from the local Kermit terminates AS-Kermit, but it is necessary to connect back in order to log off from the CANDE session. When exiting the local Kermit it may not disconnect from the communication line so it is advisable to execute the HANGUP command before the EXIT command. AS-Kermit commands Kermit commands can be abbreviated using the minimally distinguishable string. For example, as a command SE could be either SET or SEND and produces an error; R, however, suffices for RECEIVE. Abbreviations are context-sensitive. As a command, SE is ambiguous; however, as an argument to STATUS, SEND may be abbreviated with S. To check for ambiguous abbreviations, an abbreviation followed by ? with no intervening space may be entered. EXIT Exit from AS-Kermit, closing any open debugging log files. AS-Kermit may be stopped in the midst of a transfer by typing ?DS or ?END. HELP Give a list of command verbs. Typing ? gives the options available for that command. QUIT A synonym for EXIT. RECEIVE Receive a file or group of files from the local Kermit. SEND ... Send file(s) specified by ... to the local Kermit. This command is used to send files to the local Kermit. After entering the SEND command to AS- Kermit, the user returns to command mode on the local Kermit and gives the RECEIVE command. If this is not done quickly enough, several "send-init" packets may arrive prematurely, but AS-Kermit will continue sending them until it gets a response or until INITIAL-CONNECTION attempts have occured (see SET RETRY ). SERVER Act as a Kermit Server with default options, or with whatever options have been established by previous SET commands. All options remain in effect as long as the server is running. To change an option, the server must be shut down and restarted after changing the option. The AS-Kermit server may be shut down from the local Kermit with the FINISH command, or by connecting back to the A-Series system and typing ?DS. In either case AS- Kermit terminates and must be run again to transfer more files. SET Set the specified parameter to the specified value. Some parameters have their own parameters. SET BINARY On some systems, transmitting 8-bit data over a typical terminal line may result in corruption of the 8th bit. Kermit uses "binary quoting" to tell the receiver to store a byte with the high bit on. This method involves extra overhead, and it should be used only when necessary to guarantee the integrity of the 8th bit of data. A text file does not normally need the eighth bit preserved. = ON: Use "binary quoting" when transmitting bytes with the high bit on. = OFF: Do not send any "binary quotes" when transmitting. The received value of the high bit is assumed to be arbitrary. This is the default. SET BLOCK-CHECK AS-Kermit supports 3 different block-checks, called type 1, 2 and 3. Kermit uses block-checks to detect data corruption during transmission. The larger values of block-check type provide better protection against errors at the expense of more processor time used to calculate them. For short packets of less than 100 bytes block- check type 1 is adequate. For longer packets or noisy communication lines, larger block-checks may be used. The default block-check is 1. Both Kermits must agree to use the same block-check if type 2 or 3 is to be used and not all Kermits support all types. = 1, 2, or 3. SET DEBUGGING