Previous Page Contents Page Next Page

5.5 Transferring Files from the Solaris Command Prompt

You can use the following methods to transfer files between your Solaris computer and the host by issuing commands from the Solaris command prompt while a 3270 display session is running:

The display session used by the file transfer must have a session ID assigned to it, because the 3270 emulation program uses the session ID to associate the file transfer with a particular display session. See Customizing Display Sessions, for information about session IDs, or Starting the 3270 Emulation Program, for information about specifying session IDs on the command line when starting the program.

You can also issue file transfer commands with the 3270 emulation program running in the background (for more information, see Running 3270 Emulation in the Background). However, you cannot perform the logon sequence to the host (since you cannot access the 3270 display directly when the 3270 emulation program is running in the background). Therefore, you need a HLLAPI application that logs on to the host and then disconnects to leave the session available for other applications; you have to run this application after starting the 3270 emulation program and before issuing the file transfer command. Refer to the sample program in the SNAP-IX HLLAPI Programmer's Guide for an example of this type of application. The sample program will probably require modification to suit your particular host's logon sequence.

Sample file transfer commands for each host type are shown in Sample File Transfer Commands.

5.5.1 File Transfer Command Syntax

Most of the parameters you enter with the command are common to all host environments, but some are specific to the host environment.

If you want information about the valid parameters and options for a particular host type while attempting to start a command-line file transfer process, type either tnsend or tnreceive followed by the host type (TSO, VM or CICS) to generate help messages that explain the syntax for the particular host type. Syntax errors in the file transfer command (for example, not enough parameters supplied or incorrect parentheses) also generate messages.

If your host file transfer program requires any other parameters or options that are not described in the following sections, you can add them to the file transfer command in the format expected by the host program; the emulator will not attempt to interpret them, but will pass them unchanged to the host program. Your System Administrator or host support personnel can provide you with information about any additional parameters required.

You must use a backslash (\) before characters such as parentheses and quotation marks to prevent interpretation by the Solaris shell. This may also apply to some special characters in host file names (for example $). The backslash is shown in the following syntaxes where it is required.

Syntax for MVS/TSO:
tnsend | tnreceive [-h 0x nn] Solarisfilename [SESSIONID :] [\'] datasetname [\(membername\)] [\'] [/password] [ options...]
Syntax for VM/CMS:
tnsend | tnreceive [-h 0x nn] Solarisfilename [SESSIONID :] hostfilename filetype [filemode] [\(options...]
Syntax for CICS:
tnsend | tnreceive [-h 0x nn] Solarisfilename [ SESSIONID :] hostfilename \(options... [\)comments]

File Transfer Command Parameters

The Transfer command tnsend or tnreceive is required, and specifies whether to send a file to the host or receive a file from the host. This command must be in lowercase letters.

The following list describes the parameters that make up the transfer command:

0xnn

Optional. The session ID of an active 3270 display session, specified as a hexadecimal value. If the session's ID was specified using the option when starting the 3270 emulation program and is not in the range A-Z, you must specify it using this option; if the session ID is in the range A-Z, you can either use SESSIONID: or this option. Only one of these parameters can be specified.

Solaris filename

The name of the Solaris file sent to the host or the Solaris file receiving data from the host. Specify any valid Solaris file name, with or without a path.

SESSIONID:

Optional. Either the one-character session ID (in the range A-Z) or the long name of an active 3270 display session. The ID must be in uppercase characters and followed by a colon. The session must have a session ID assigned, even if you use the long name. For information about assigning session names and IDs, see Customizing 3270 Emulation.

If the session's ID was specified using the option when starting the 3270 emulation program, you must specify it using the option in the command and not using SESSIONID:. Only one of these parameters can be specified.

If neither SESSIONID: nor 0xnn is specified, the program tries to use the session configured with the lowest hexadecimal value for its session ID.

datasetname

MVS/TSO only: required. The name of the host data set to which a named Solaris file is sent, or the name of the host data set from which data is received. If you specify a fully qualified data set name (that is, the first element of the name is a user ID), enclose the data set name in single quotation marks; the membername parameter, if used, must also be inside the quotation marks.

\(membername\)

MVS/TSO only: required if the host data set is a partitioned data set. This is the member within the data set to which a named Solaris file is sent, or from which data is received by the Solaris file. Enclose membername in parentheses.

If you are sending a file to a partitioned data set, the data set must already exist on the host. The IND$FILE program cannot create a new partitioned data set.

/password

MVS/TSO only: optional. A password is required only if the data set is password-protected. The password must be preceded by a slash.

hostfilename

VM/CMS or CICS: required. The name of the host file to which the data is sent, or the name of the host file from which data is received.

filetype

VM/CMS only: required. This is the VM/CMS file type of the host file.

filemode

VM/CMS only: optional. This is the VM/CMS file mode of the host file. If filemode is not specified, the default A1 is used.

options or \(options

File Transfer Command Options, explains the available options. A left parenthesis before the options is required for VM/CMS and CICS, but is not valid for MVS/TSO.

\)comments

CICS only: optional for sending files, not applicable for receiving files. Any comment information that you want to send to the host; it is written into the first record of the host file. If you include a comment, it must be preceded by a right parenthesis. The comment can be up to 80 characters, although some hosts may impose a lower limit.

File Transfer Command Options

This section explains the options you can use on the command line when transferring files. Italics in the option names indicate variable parameters for each option, which are explained in the description of each option. The options are not case-sensitive; you can use either uppercase or lowercase letters.

The valid options differ according to the host type and whether you are sending or receiving files. See File Transfer Command Options, for details of when each option is allowed; the list following the table explains each option.

File Transfer Command Options

OptionHost TSOVM/CMS CICS
X X R
X X X
- - X
X X X
X X X
X X X
- - X
X X X
S S -
S S -
S - -
S - -
X X X
X X X
X X X

Key:

X

This parameter is used for both Send and Receive.

-

This parameter is not used for this host type.

R

This parameter is used for Receive only. Do not use for Send.

S

This parameter is used for Send only, when creating a new host data set or host file. Do not use for Receive or when replacing or appending to an existing host data set or host file.

For CICS, you must specify either or , and either or .

The following list describes each of the file transfer options:

Causes the file being sent to be added to the end of the target Solaris file, host file, or host data set. If the file does not exist, it is created.

Causes the file to be translated between ASCII (on the Solaris computer) and EBCDIC (on the host). Specify this option only for text files, not for binary files. For CICS, you must specify either this option or the option. See also and later in this list.

CICS only; you must specify either this option or the option . This option causes the file to be transferred without translation. Specify this option only for binary files, not for text files.

Specifies the host (EBCDIC) code page for translation. This option is valid only if the option is used.

If is specified but is not specified, the default code page depends on the options you used when starting the 3270 emulation program, as follows:

  • If you started the program with the (user-defined translation table) option, the default is to use the user-defined translation table. If you override this by using , you must also specify to set the local code page; you cannot use one without the other.

  • If you started the program with the (international) option, the default is the appropriate code page for your selected host language.

  • If you did not use either or , the default is Code Page 037. For more information about code pages, see Supported Code Pages.

Specifies the local (ASCII) code page the host should use to translate the file received from the Solaris computer. is valid only if the option is used.

If is specified but is not specified, the default code page depends on the options you used when starting the 3270 emulation program, as follows:

  • If you started the program with the (user-defined translation table) option, the default is to use the user-defined translation table. If you override this by using , you must also specify to set the host code page; you cannot use one without the other.

  • If you started the program with the (international) option, the default code page is 8859.

If you did not use either or , the default code page is 437. For more information about code pages, see Supported Code Pages.

Causes the program to delete line-feed characters before sending the file to the host or to add line-feed characters when receiving the file from the host. is normally required for text files. For CICS, you must specify either this option or the option.

CICS only; you must specify either this option or the option. is the converse of , and specifies that line-feed characters are not to be added or deleted.

Specifies the timeout period. File transfer is canceled if the host does not respond within this time. The variable nn represents the number of 30-second intervals, between 00 and 99, to wait; for example, T(02) equals 1 minute. A TRANS010 message is generated every 30 seconds until the timeout period has expired (but see the option later in this list).

If is not specified, or if T(00) is specified, the file transfer process waits indefinitely for the host to respond. No timeout messages are displayed.

Specifies the block size of the data set (n is the block size in bytes). If is omitted, the default is .

Specifies one of the following:

  • The logical record length of the host file if the value of is ().

  • The maximum length if the value of is ().

If is not specified, the default is 80.

Specifies the record format of the host file:

  • specifies a file containing fixed-length records.

  • specifies a file containing variable-length records.

  • specifies a data set containing records of undefined length (this is valid only for MVS/TSO, not for VM/CMS).

If is not specified, the default is F, unless the option is specified, in which case the default is V. This option is valid only when creating a new MVS/TSO host data set; do not use it when replacing or appending to an existing data set.

Specifies the space to allocate for a new data set. You can specify the unit of space measurement as TRACKS, CYLINDERS, or AVBLOCK \(n\) (blocks of size n bytes). The value q indicates the amount of space initially allocated, in the units specified by unit, and i is the increment to add, in the units specified by unit, each time the space previously added is filled. The increment i is optional. If it is not specified, and the initial space q is filled before the transfer is completed, the file transfer fails. If i is supplied, the comma before it is required.

Specifies quiet mode, which suppresses the display of all file transfer messages. The format is also accepted for this option.

5.5.2 Sample File Transfer Commands

This section contains sample command lines for file transfer to and from the different host types. Note the use of the backslash (\) character in all these examples; it is used as an escape character to prevent interpretation of parentheses and quotation marks by the Solaris shell.

MVS/TSO tnsend Command

tnsend filea.txt A: \'id.text.mytext\(filea\)\' ASCII H\(277\) P\( 865\) CRLF

This command sends the file filea.txt (from the current Solaris directory) to the member filea of the MVS/TSO partitioned data set id.text.mytext, using the 3270 session with a session ID of A. The host translates the file from ASCII to EBCDIC, using the host code page 277 and the PC (ASCII) code page 865, and removes line-feed characters.

VM/CMS tnreceive Command

tnreceive /usr/jim/file2.txt SESS02: mytext script \(crlf ascii t\(03\)

This command receives the VM/CMS file mytext with file type script (the file mode is not specified, so it is assumed to be A1) and stores it in the directory /usr/jim as a file named file2.txt; the host translates the file from EBCDIC to ASCII and adds line-feed characters. The file transfer uses the display session with long name SESS02. The transfer will be canceled if the host fails to respond within 90 seconds (three 30-second timeout periods).

CICS tnsend Command

tnsend -h 0x01 FILE3 mytext \(ASCII NOCRLF\) Sales Meeting Report

This command sends the file named FILE3 in the current directory to the CICS file mytext. The file transfer uses the display session with session ID 0x01 (this session ID will have been specified on the command line when starting the 3270 emulation program). The host translates the file from ASCII to EBCDIC, but does not remove line-feed characters. The comment Sales Meeting Report is written to the first record of the host file.

Previous Page Contents Page Top of Page Next page