 |
» |
|
|
 |
You can use the following methods to transfer files between
your HP-UX computer and the host by issuing commands from the HP-UX
command prompt while a 3270 display session is running: Use the TEMPEXIT keystroke from the
character-based TN3270 emulation program to run another shell on
the same terminal. Move to another terminal window on the Motif display. Log on at another terminal on the same HP-UX computer
on which you started the TN3270 emulation program, using the same
user ID.
The display session used by the file transfer must have a
session ID assigned to it, because the TN3270 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 TN3270 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 TN3270
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 TN3270 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 TN3270 emulation program and before issuing the
file transfer command. Refer to the sample program in the HP-UX
SNAplus2 3270 & TN3270 HLLAPI Programmers 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”. 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 HP-UX 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 0xnn] HP-UXfilename [SESSIONID:] [\'] datasetname [\(membername\)] [\'] [/password] [options...] |
- Syntax for VM/CMS:
tnsend | tnreceive [-h 0xnn] HP-UXfilename [SESSIONID:] hostfilename filetype [filemode] [\(options...] |
- Syntax for CICS:
tnsend | tnreceive [-h 0xnn] HP-UXfilename [ SESSIONID:] hostfilename \(options... [\)comments] |
File Transfer Command ParametersThe 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: - -h
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 -h
option when starting the TN3270 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. - HP-UX filename
The name of the HP-UX file sent to the host or the
HP-UX file receiving data from the host. Specify any valid
HP-UX 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 Chapter 6 “Customizing 3270 Emulation” If the session's ID was specified using the -h
option when starting the TN3270 emulation program, you must specify
it using the -h option in the command and not using
SESSIONID:. Only one of
these parameters can be specified. If neither SESSIONID:
nor -h 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 HP-UX 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 HP-UX file is sent, or from which
data is received by the HP-UX 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 OptionsThis 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 Table 5-4 “File Transfer Command Options” for details of when each option is allowed;
the list following the table explains each option. Table 5-4 File Transfer Command Options | Option | Host
TSO | VM/CMS | CICS |
|---|
| APPEND | X | X | R | | ASCII | X | X | X | | BINARY | - | - | X | | H\(nnn\) | X | X | X | | P\(nnn\) | X | X | X | | CRLF | X | X | X | | NOCRLF | - | - | X | | T\(nn\) | X | X | X | | LRECL
\(n\) | S | S | - | | RECFM
F|V|U | S | S | - | | BLKSIZE
\(n\) | S | - | - | | SPACE
\(q, i \)
unit | S | - | - | | Q or
/Q | X | X | X | | SO | X | X | X | | NOSO | 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 ASCII or
BINARY, and either CRLF or NOCRLF. If you are communicating with a Japanese host, the keyword
ASCII is replaced by JISCII. See the note on this parameter
below. The following list describes each of the file transfer options: - APPEND
Causes the file being sent to be added to the end
of the target HP-UX file, host file, or host data set. If the file
does not exist, it is created. - ASCII
Causes the file to be translated between ASCII (on
the HP-UX 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 BINARY option. See also
H(nnn)
and P(nnn)
later in this list. If you are communicating with a Japanese host,
specify the keyword JISCII
instead of ASCII. - JISCII
Equivalent to the ASCII option but used with Japanese
hosts (which recognize the keyword JISCII
instead of ASCII). If you are
communicating with a Japanese host, specify the JISCII
option; otherwise, specify ASCII. The two options
are used in exactly the same way. - BINARY
CICS only; you must specify either this option or
the ASCII option (JISCII
instead of ASCII if you are
communicating with a Japanese host). This option causes the file
to be transferred without translation. Specify this option only
for binary files, not for text files. - H\(nnn\)
Specifies the host (EBCDIC) code page for translation.
This option is valid only if the ASCII option (or
JISCII for a Japanese host) is used. If ASCII or JISCII is specified
but H(nnn)
is not specified, the default code page is the appropriate code
page for the host language you are using (defined by the LANG environment
variable). For more information about host language selection and
code pages, see “Supported Code Pages”. - P\(nnn\)
Specifies the local (ASCII) code page the host should
use to translate the file received from the HP-UX computer. P(nnn)
is valid only if the ASCII option (or JISCII
for a Japanese host)is used. If ASCII or JISCII is specified
but P(nnn)
is not specified, the default code page is the appropriate code
page for the host language you are using (defined by the LANG environment
variable). For more information about host language selection and
code pages, see “Supported Code Pages”. - CRLF
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. CRLF is
normally required for text files. For CICS, you must specify either
this option or the NOCRLF option. - NOCRLF
CICS only; you must specify either this option or
the CRLF option. NOCRLF is the
converse of CRLF, and specifies that line-feed
characters are not to be added or deleted. - T\(nn\)
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 Q
option later in this list). If T(nn)
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. - BLKSIZE (n)
Specifies the block size of the data set (n
is the block size in bytes). If BLKSIZE n
is omitted, the default is LRECL. - LRECL \(n\)
Specifies one of the following: The logical record length of the host file if the
value of RECFM is (F). The maximum length if the value of RECFM
is (V).
If LRECL(n)
is not specified, the default is 80.- RECFM \(F|V|U\)
Specifies the record format of the host file: RECFM \(F) specifies a
file containing fixed-length records. RECFM \(V) specifies a
file containing variable-length records. RECFM \(U) specifies a
data set containing records of undefined length (this is valid only
for MVS/TSO, not for VM/CMS).
If
RECFM is not specified, the default is F, unless the CRLF
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. - SPACE \(q, i\) unit
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. - Q
Specifies quiet mode, which suppresses the display
of all file transfer messages. The format /Q is
also accepted for this option. - SO
Use this option to add shift out / shift in (SO/SI)
characters to any HP-UX text file sent to the host, or to convert
SO/SI characters to right- and left- arrow symbols (0x2D3E and 0x3C2D)
in any HP-UX text file received from the host. This option is used only for files containing double-byte
characters, and only when the ASCII option (or
JISCII for Japanese) is specified. It is ignored
if ASCII (or JISCII) is not specified.
Do not use this option if the selected host language is a single-byte
language. When sending a file to the host, SO
is the default unless you specify the NOSO option;
when receiving from the host, NOSO
is the default unless you specify SO.
Do not specify both options together. - NOSO
Use this option to send any HP-UX text file to the
host without adding shift out / shift in (SO/SI) characters, or
to remove SO/SI characters from any HP-UX text file received from
the host. This option is used only for files containing double-byte
characters, and only when the ASCII option (or
JISCII for Japanese) is specified. It is ignored
if ASCII (or JISCII) is not specified.
Do not use this option if the selected host language is a single-byte
language. When sending a file to the host, the SO option
(see above) is the default unless you specify NOSO; when receiving
from the host, NOSO is the default unless you specify SO. Do not specify both options
together.
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 HP-UX shell. Example 5-1 MVS/TSO tnsend Command
tnsend filea.txt A: \'id.text.mytext\(filea\)\' ASCII H\(277\) P\( 8859\) CRLF |
This command sends the file filea.txt
(from the current HP-UX 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 8859, and removes line-feed characters. Example 5-2 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). Example 5-3 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 TN3270 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. Example 5-4 MVS/TSO tnreceive Command to a Japanese Host
tnreceive /usr/jim/filea.txt SESS2: text.mytext.filea \(crlf jiscii so\) |
This command receives the MVS/TSO partitioned data set text.mytext.filea
and stores it in the directory /usr/jim
as a file named filea.txt.
The host translates the file from EBCDIC to JISCII (Japanese ASCII),
converts SO/SI characters to right- and left-arrow symbols (0x2D3E and 0x3C2D),
and adds line-feed characters. The file transfer uses the display
session with long name SESS2.
|