3780 Receive Command

More from CTI...
 
 
 
 


FUNCTION Instructs the program to enter receive mode and wait for incoming data.

SYNTAX .RCVE,FileName [(OptionString)]

REMARKS The program automatically detects whether the incoming data is in binary or text mode and adjusts accordingly.

FileName is in one of two formats:

With a Dot

(FileName.Ext) The receive file name is used as specified. If the file exists, then DataFile.nnn is used as the file name and a message is displayed.

Without a Dot

(prefix only) The program adds an extension of ".000" and checks to see if the file already exists. If it does, the extension ".001" is created and checked until a file name is created that does not exist. That name is used as the receive file name and a message is displayed on the screen and in the report file.

If the file name uses a prefix only (no dot), the program opens a new file and increments the extension each time an ETX (End of Text) protocol character is received. The process of creating a new file each time an ETX is received continues until an EOT (End of Transmission) is received from the remote system.

OptionString can contain one or more of the following text strings. If OptionString is used, the entire list of options must be surrounded by parentheses "( )."

noetx

Ignore incoming ETX (End of Text) protocol characters and write all data to the file until an EOT (End of Transmission) is received.

echo

Echo received data to the screen at the same time it is being written to the file.

nodev

Do not check for device selection characters. Write all data (including any device selection characters) to the file.

append

If the specified file name already exists, append any data received to the end of that file. If the file name does not exist, create it.

overwrite

If the specified file name exists, overwrite the file with the data being received.

retries n

Normally an EOT (End of Transmission) signals that the remote computer has no more data to send. Some 3780 software available on mainframes sends an EOT after the line bid while waiting for the operating system to make a data file available, even though the EOT means that there is no data to send.

If the "retries n" parameter is used (with a number ranging from 2 to 256 in place of the "n"), FastSync ignores any EOT following the line bid up to n times.

iferr nnn

The "iferr nnn" option allows you to target an error routine to be executed if the command fails. It has the same effect as using an ".IF...Then .GOTO nnn" statement as the next command in the command file.

Substitute a numeric label for the "nnn" in the option. If the command fails, command file execution resumes with the statement following the label.

formfeed

The "formfeed" option is used when receiving files to a printer. A command is sent to the printer to advance to the beginning of the next page before FastSync begins to print the incoming file.

max nn

If the file name does not contain a dot, it receives no more than nn files. This option is used when a remote sends both a response and data file without an EOT between them. This command allows use of two different file names.

start ByteCount

When this parameter is used, FastSync begins writing data to the file at the specified location in the file (assuming the file exists). If the file length is greater than the specified start position, data written to the file overwrites the existing data from the start position. This option is similar to the "append" option in that the data is written to a pre-existing file.

EXAMPLES

.RCVE,MyFile.txt incoming data is written to the file MyFile.txt

.RCVE,MyFile all incoming data is written to the file MyFile.nnn where "nnn" is a unique numeric extension (beginning with "000")

.RCVE,MyFile (noetx) incoming data is written to a single file until an EOT is received. ETX protocol characters are ignored

.RCVE,MyFile (echo) the received data is written to the file MyFile.nnn and displayed on the screen at the same time. The "echo" option could also be used when the file name extension is specified

.RCVE,MYFILE.EXT (nodev append)

Do not examine the first incoming record for device selection characters. Append any data received to the end of MyFile.ext

.RCVE,MYFILE.EXT (overwrite)

overwrite the existing file with the incoming data

.RCVE,CONS receives data to the screen (console)

.RCVE,LPT1 receives data to a PC printer

.RCVE,LPT0 receives data to a printer connected to the back of a DCP-88 card

Comment:  As long as there is no chance that the file already exits, the use of file extensions are fine.  For example, if the FastSync 3780 program is invoked as part of a batch file and that batch file makes sure that files (including the extensions) are deleted, the existence of the files after FastSync runs can be used as an indication of success or failure.  Normally one does not want to use file extensions, since the FastSync program will use the default file name if the file already exists.