Your browser does not allow this site to store cookies and other data. Some functionality on this site may not work without them. See Privacy Policy for details on how we would use cookies.

SSH Tectia

Site Command

The Site commands are the recommended way for controlling file transfer when both the client and server host are running SSH Tectia.

For command descriptions, see the site and lsite command in sftpg3(1) and the --dst-site and --src-site options in scpg3(1).

When giving the command, either the abbreviation or the full command can be used. For example, the following two commands accomplish the same thing:

sftp> site X=bin
sftp> site transfer_mode=bin

File Transfers between z/OS Machines

When datasets are transferred between z/OS machines, the destination dataset is by default allocated with the same attributes as the source dataset. The attributes for the destination dataset can be overridden with the Site commands.

[Note]Note

If you change the dataset record format from VB to FB during transfer, you have to specify both BLKsize and LRecl for the destination dataset. Otherwise, an error may occur if the block size does not match the record length.

Site Parameters

The available Site parameters are:

A|transfer_translate_dsn_templates=TEMPLATES

TEMPLATES specifies the search templates for the translate table. Write '%T' to show the point where the translate table name (see above) is to be inserted. Delimit the templates with a plus character. The dataset name templates must not contain slashes, instead they must be preceded by two or three underscores. See Dataset and HFS File System Access.

The first translate table dataset that is found is used to perform the code conversion.

[Note]Note

The translate table must translate line delimiters into EBCDIC NL characters. See F|transfer_format=FORMAT.

Default: none

B|BLKsize|BLOCKSIze=SIZE

Maximum block size.

Default: none

BLocks

Specifies that the space allocation unit is blocks. Equal to space_unit=blks.

C|transfer_codeset=CODESET

During the transfer the data has the specified codeset. CODESET is the codeset name that is known to the iconv function of the system performing the conversion. The available codesets can be listed by invoking the iconv command at a USS prompt with the -l option:

$ iconv -l 

Default: none

In the following example, a z/OS SFTP client puts a dataset to a Windows file and gets a file from Windows:

sftp> lsite C=ISO8859-1 D=IBM-1047
sftp> sput //DATASET.TXT file.txt
sftp> sget file.txt //DATASET.TXT

The lsite command tells the z/OS client that codeset during transfer is ISO8859-1 and that the dataset is stored on the client with the IBM-1047 codeset. In sput, this means that the client converts the codeset from IBM-1047 to ISO8859-1 before sending the data. In sget, this means that the client converts the codeset from ISO8859-1 to IBM-1047 upon receiving the data.

[Note]Note

The codeset information is always given to the host that is capable of performing the conversion, in this case the z/OS host.

CONDdisp=catlg|delete

Specify what happens when a file transfer ends prematurely.

If set to CATLG, the dataset is kept when a file transfer ends prematurely. For MVS dataset transfers, the dataset is also cataloged.

If set to DELETE, the dataset is deleted when a file transfer ends prematurely.

Default: catlg

CYlinders

Specifies that the space allocation unit is cylinders. Equal to space_unit=cyls.

D|transfer_file_codeset=CODESET

The data in the dataset has the specified codeset. CODESET is the codeset name that is known to the iconv function of the system performing the conversion. The available codesets can be listed by invoking the iconv command at a USS prompt with the -l option:

$ iconv -l 

Default: none

DATAClass|dataclas=CLASS

Specifies the data class of a dataset.

Default: none

E|transfer_translate_table=TABLE

TABLE is the name of the table that specifies the codeset conversion. If set, this attribute overrides the transfer codeset and file codeset attributes. The table is always applied in the normal direction, that is, the first character array is used for incoming (from the line to the dataset) data and the second array for outgoing data. If the opposite translation is needed, e.g. the dataset contains ASCII and should be transferred as EBCDIC, the users (or their system programmer) can prepare a table dataset with the character arrays in reversed order (e.g. with the system utility CONVXLAT or by editing an existing translate dataset).

F|transfer_format=FORMAT

The byte stream consists of the bytes that are transferred as payload in the SFTP protocol packets. The byte stream has one of the following formats: stream, line, or record. All three formats may have data consisting of text, non-text data, or a mixture of these.

When writing an MVS dataset, a record that is longer than the maximum or fixed record length will cause an error unless record_truncate is set to yes, in which case it will be truncated. When writing to datasets with fixed record lengths, short records will be filled with binary zeroes if you use the record transfer format and with blanks if you use the line transfer format.

  • F=stream: The stream transfer format contains the data bytes of the dataset but no structural information. If a dataset with a fixed record length is transferred with the stream format and recreated with the same record length, the record structure will be preserved. Variable length records will not be recreated properly if transferred with the stream format.

  • F=line: The line transfer format is record-based. It uses delimiter characters to mark the end of a record. The delimiter character may be a Carriage Return or a Newline. When writing to or reading from datasets with ASA control characters, a Form Feed is also treated as a delimiter. The table below shows the values of these characters in EBCDIC and ASCII. Data sent to SSH Tectia client tools for z/OS in the line transfer format must be in EBCDIC or must be converted to EBCDIC during the transfer.

    Delimiter          EBCDIC                    ASCII
                       Name  Dec   Oct   Hex     Name  Dec   Oct   Hex
    \r Carriage Return CR    13    015   0x0D    CR    13    015   0x0D
    \n Newline         NL    21    025   0x15    LF    10    012   0x0A
    \f Form Feed       FF    12    014   0x0C    FF    12    014   0x0C
    

    Note that ASCII does not have a NL character, instead LF is used to delimit lines.

    Avoid conversions that transform an ASCII Line Feed (LF/10/012/0x0A) into an EBCDIC Line Feed (LF/37/045/0x25) or an EBCDIC Newline (NL/21/025/0x15) into an ASCII Next Line (NEL/133/0205/0x85).

    Be aware that sending a double delimiter, e.g. \r\n or \n\r, to SSH Tectia client tools for z/OS will result in two records. The transfer-line- delimiter and file-line-delimiter advice string attributes can be used to cause the SSH Tectia client tools for z/OS server or client program to convert between the line delimiter conventions.

    SSH Tectia client tools for z/OS sends \n as the Server Newline Convention in the server initialization SFTP protocol message.

    When transferring line format data to and from MVS files with ASA line printer control characters, SSH Tectia client tools for z/OS will convert between the control characters and line delimiter characters, as described in the IBM document z/OS C/C++ Programming Guide, SC09-4765-03, Chapter 8.

    To transfer records without changing the ASA code, use the stream or record transfer format, or define the dataset using a DD card and specify RECFM=FB or RECFM=VB.

    Datasets transferred in the line transfer format and recreated on a mainframe will not necessarily be identical.

  • F=record: The record transfer format is record-based. Each record is preceded by a length field consisting of a 4- byte big-endian binary integer, which indicates the number of data bytes in the record. Note that the format is not the same as the record descriptor word in datasets with RECFM=V or VB.

    A dataset that is transferred with the record transfer format can be recreated as any dataset type.

Default: line.

fixrecfm=LENGTH

The dataset organization is set to FB and the fixed record length is set to LENGTH.

Default: none

I|transfer_line_delimiter=CONVENTION

The transfer line delimiter specifies the newline convention used during the file transfer. Possible values are:

  • I=mvs: The line delimiter during the transfer is NL (\n, 0x0a).

  • I=unix: The line delimiter during the transfer is NL (\n, 0x0a).

  • I=dos: The line delimiter during the transfer is LFNL (\r\n, 0x0d0a).

  • I=mac: The line delimiter during the transfer is LF (\r, 0x0d).

Default: none

In the following example, z/OS SFTP client puts a dataset to a Windows file and gets a file from Windows:

sftp> lsite I=dos J=mvs
sftp> sput //DATASET.TXT file.txt
sftp> sget file.txt //DATASET.TXT

The lsite command tells the z/OS client that the line delimiter during the transfer is LFNL and that the dataset is stored with the NL line delimiter. In sput, this means that the client converts the line delimiters from NL to LFNL before sending the data. In sget, this means that the client converts the line delimiters from LFNL to NL upon receiving the data.

[Note]Note

The line delimiter information is always given to the host that is capable of performing the conversion, in this case the z/OS host.

J|transfer_file_line_delimiter=CONVENTION

The transfer file line delimiter specifies the newline convention used in the (source or destination) file. Possible values are:

  • J=mvs: The line delimiter used in the file is NL (\n, 0x0a).

  • J=unix: The line delimiter used in the file is NL (\n, 0x0a).

  • J=dos: The line delimiter used in the file is LFNL (\r\n, 0x0d0a).

  • J=mac: The line delimiter used in the file is LF (\r, 0x0d).

Default: none

keylen=LENGTH

Specifies the length in bytes of the keys used in the dataset.

Default: none

keyoff=OFFSET

Specifies the key offset. The position of the first byte of the key in records of the specified VSAM dataset.

Default: none

L|size=SIZE

Size estimate in bytes for dataset allocation.

Default: 1000000

like=LIKE

Specifies the name of a model dataset from which the RECfm, BLKsize, and LRecl attributes are to be copied. The name must be the full DSN of a cataloged dataset and must be preceded with three underscores.

You must include the type attribute when using like unless you are creating a PS dataset and the model is a PS dataset.

Default: none

M|DIrectory|directory_size=SIZE

Number of 256-byte records in the directory.

Default: 10

MGmtclass|mgmtclas=CLASS

Specifies the management class of a dataset.

Default: none

NOTRAILingblanks

Equal to trailing_blanks=no.

NOTRUNcate

Equal to record_truncate=no.

O|RECfm=RECFM

RECFM specifies the dataset organization. The possible values are all valid combinations of the following letters:

    F       Fixed
    V       Variable
    U       Undefined
    B       Blocked
    S       Spanned or standard
    M       Machine line printer codes
    A       ASA line printer codes

Default: vb

P|profile=PROFILE

The file transfer profile specifies the named profile used for the file transfer. The profile name is case-sensitive. With special profile name P=% no profiles are used. This also prevents profile matching based on file name.

Default: none

PRImary|primary_space=SPACE

Primary space allocation for a dataset.

Default: none

R|LRecl=LENGTH

Maximum record length or fixed record length.

Default: 4096, for VSAM, 80, if dataset organization is F or FB, otherwise 1024

SECondary|secondary_space=SPACE

Secondary space allocation for a dataset.

Default: none

space_unit=UNIT

Unit of space allocation for a dataset.

Possible values are:

  • space_unit=blks: Allocation unit is blocks.

  • space_unit=cyls: Allocation unit is cylinders.

  • space_unit=trks: Allocation unit is tracks.

  • space_unit=avgreclen: Allocation unit is average record length.

Default: none

space_unit_length=LENGTH

When space_unit=blks or space_unit=avgreclen, specifies the size of the space allocation unit.

Default: 100 with space_unit=avgreclen, none with space_unit=blks

STOrclass|storclas=CLASS

Specifies the storage class of system managed storage.

Default: none

T|type=TYPE

The file type specifies the type of the dataset when the dataset is created. The available values are:

  • T=hfs: The type of the created dataset is HFS.

  • T=po: The type of the created dataset is PDS.

  • T=poe: The type of the created dataset is PDSE.

  • T=vsam: The type of the created dataset is VSAM.

  • T=ps: The type of the created dataset is PS.

Default: po, if dataset name includes member, otherwise ps

TRacks

Specifies that the space allocation unit is tracks. Equal to space_unit=trks.

trailing_blanks=yes|no

Specify whether to preserve trailing blanks in a transferred dataset.

If set to yes trailing blanks will be transferred. This can be used, for example, to preserve the structure of fixed format datasets.

If set to no trailing blanks will be stripped.

Default: no

TRAILingblanks

Equal to trailing_blanks=yes.

TRUNcate

Equal to record_truncate=yes.

U|record_truncate=yes|no

When a record truncation occurs while writing an MVS dataset, the system will continue writing the dataset if record_truncate is set to yes; and the system will abort the transfer if record_truncate is set to no or omitted.

Record truncation will occur if the length of a transferred record (after codeset and line delimiter conversion) is larger than the maximum record length of the dataset. Truncation can occur only when the transfer format is line or record. Note that the stream format does not have any concept of records in transferred data and it will fill out all records to their maximum length.

In the line transfer format, the length of a transferred record is the number of characters up to a newline character.

In the record format, the length of a transferred record is given by the 4 byte binary length field which precedes the record.

The maximum length of a dataset record depends on the dataset organization:

  F and FB - LRECL
  V and VB - LRECL-4
  U        - BLKSIZE
  VSAM     - MAXRECLEN

When SSH Tectia client tools for z/OS aborts writing a dataset because of record truncation, it will complete the write operation during which the system observed the truncation. It will write to disk one or more records, at least one of which is truncated. The dataset is left on the system.

SSH Tectia client tools for z/OS may write a large amount of data in one write operation, typically 32kB. Several records may be written in the last operation, some of them truncated. Small files may be written to the end of the file, and thus the resulting dataset will be equivalent to one written with setting record_truncate=yes.

Note that some file transfer client programs do not always show the error or warning messages from the server. Using the verbose mode (--verbose, -v) may show more messages from the server.

[Note]Note

When SSH Tectia client tools for z/OS writes a dataset with record_truncate=yes, data loss may occur.

unit=UNIT

The name of device or group of devices that the dataset will reside on (or does reside on, if it already exists). The maximum length of UNIT is 8 characters. If the value exceeds the maximum length, it is truncated to 8 characters.

It is also possible to specify a device address. Precede a four digit address with an underscore.

Default: none

volumes=VOLUMES

A plus sign (+) separated list of volumes a dataset will reside on (or does reside on, if it already exists).

Default: none

X|transfer_mode=MODE

The transfer mode specifies whether codeset and line delimiter conversions are performed. The available values are:

  • X=bin: Codeset and line delimiter conversions are not performed.

  • X=text: Codeset and line delimiter conversions are performed.

Default: none

[Note]Note

If transfer_mode is not given but both transfer_codeset and transfer_file_codeset or transfer_translate_table are present conversions are performed.

===AUTO_SCHEMA_MARKUP===