SSH

Advice String

Since the SFTP server decodes the name for the data set, the file name in the request can be used to convey other information. The following file name convention is used: any file name that starts with /ftadv: has the format

/ftadv:advstr/realfilename

where advstr is the advice string and realfilename is the data set name or a file name to be further processed by the server.

The advice string is either a sequence of name=value pairs delimited by commas, or a one-word shortcut. For ease of use, some advice string names also have abbreviations.

For example: /ftadv:automount=YES/, /ftadv:automount/ and /ftadv:AUTOM/ all enable automount.

The advice string names and abbreviations are as follows:

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 data set name templates must not contain slashes, instead they must be preceded by two or three underscores. Fore more information, see Data Set and HFS File System Access.

The first translate table data set 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

automount=YES|NO|IMMED

If set to YES and a normal allocation fails because a data set is not online, Tectia will allocate it and request the system to mount it. This requires that the user has read permission to the SSZ.MOUNT facility.

If set to NO, offline data sets are not mounted automatically.

If set to IMMED, Tectia will not attempt the normal allocation, it will request the system to mount the data set immediately.

Default: no

AUTOMount

Equal to automount=YES.

autorecall=YES|NO

Defines whether data sets migrated by a storage manager are recalled automatically.

Default: YES

AUTORecall

Equal to autorecall=YES.

B|blksize=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 code set. CODESET is the code set name that is known to the iconv function of the system performing the conversion. The available code sets 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 Windows SFTP client puts a file to a z/OS data set and gets a data set from z/OS:

sftp> sput file.txt /ftadv:C=ISO8859-1,D=IBM-1047/__DATASET.TXT
sftp> sget /ftadv:D=IBM-1047,C=ISO8859-1/__DATASET.TXT file.txt

In sput, the Windows client tells the z/OS server that the code set during the transfer is ISO8859-1 and that the server should store the data set with the IBM-1047 code set. In sget, the Windows client tells the z/OS server that the code set in the data set is IBM-1047 and it should be converted to ISO8859-1 before transferring the data to the Windows client.

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

sftp> sput /ftadv:C=ISO8859-1,D=IBM-1047/__DATASET.TXT file.txt
sftp> sget file.txt /ftadv:C=ISO8859-1,D=IBM-1047/__DATASET.TXT

In sput, the z/OS client is told that code set in the data set is IBM-1047 and it should be converted to ISO8859-1 before transferring the data to the Windows server. In sget, the z/OS client is told that the file has the ISO8859-1 code set during the transfer and the data set should be stored with the IBM-1047 code set.

[Note]Note

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

conddisp=CATLG|UNCATLG|KEEP|DELETE

Specifies the disposition of the output file when a file transfer ends prematurely (the client or server are alive but disconnected from the other end; for example, when pressing CTRL+C in the client).

[Note]Note

If the client (when transferring to local or client side) or the server (when transferring to remote or server side) dies, they will have no control over the disposition.

The options have the following effects, depending of the file type (MVS or HFS):

  • CATLG: an MVS data set is retained and its name is cataloged. An HFS file is retained.

  • UNCATLG: the name of an MVS data set is removed from the catalog but it is retained. An HFS file is retained.

  • KEEP: an MVS data set is retained (if cataloged it will be still cataloged, if uncataloged it will be still uncataloged). An HFS file is retained.

  • DELETE: the name of an MVS data set is removed from the catalog and the space allocated for it is released. An HFS file is deleted.

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 data set has the specified code set. CODESET is the code set name that is known to the iconv function of the system performing the conversion. The available code sets can be listed by invoking the iconv command at a USS prompt with the -l option:

> iconv -l 

Default: none

dataclas=CLASS

Specifies the data class of a data set.

Default: none

dataset_sequence_number=NUMBER

Identifies the relative position of a data set on a tape volume.

Default: System default

defer=YES|NO

Specify whether data set allocation is postponed from allocation phase to opening the data set.

If set to YES data set allocation is postponed until data set is opened.

If set to NO data set is allocated in allocation phase.

Default: NO

DEfer

Specifies that data set allocation is postponed until data set is opened. Equal to defer=YES.

E|transfer_translate_table=TABLE

TABLE is the name of the table that specifies the code set conversion. If set, this attribute overrides the transfer code set and file code set 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 data set) data and the second array for outgoing data. If the opposite translation is needed, e.g. the data set contains ASCII and should be transferred as EBCDIC, the users (or their system programmer) can prepare a table data set with the character arrays in reversed order (e.g. with the system utility CONVXLAT or by editing an existing translate data set).

expiry_date=YYDDD|YYYYDDD

Specifies the expiration date for a new data set. On and after this date, the operating system can delete or write over the data set.

Default: System default

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 data set, 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 data sets 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 data set but no structural information. If a data set 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 (CR) or a Newline (NL). When writing to or reading from data sets with ASA control characters, a Form Feed (FF) is also treated as a delimiter. The table below shows the values of these characters in EBCDIC and ASCII. Data sent to 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 Line Feed (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 Tectia client tools for z/OS will result in two records. The transfer_line_delimiter and transfer_file_line_delimiter advice string attributes can be used to cause the Tectia client tools for z/OS server or client program to convert between the line delimiter conventions.

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, 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 data set using a DD card and specify RECFM=FB or RECFM=VB.

Data sets 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 data sets with RECFM=V or RECFM=VB.

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

Default: LINE.

file_status=NEW|MOD|SHR|OLD

Defines the status of a data set. If entered, the value will be used when allocating the data set. This attribute corresponds to the first value in the DISP parameter of the JCL DD statement.

Default: NEW for data sets that will be created, SHR for data sets that will be read only, otherwise OLD.

I|transfer_line_delimiter=CONVENTION

The transfer line delimiter specifies the newline convention used in the data that is transferred over the connection. Possible values are:

  • I=MVS: The line delimiter on the connection is NL (\n, 0x15). If the data is converted from EBCDIC to ASCII, the NL becomes a LF (\n, 0x0A).

  • I=MVS-FTP: When writing to a data set, only the LF (\n, 0x0A) control codes are considered as an End Of Line. Any CR (\r, 0x0D) codes are preserved as data in the record.

    When writing data sets with ASA printer control characters, the first character on each line is used as the ASA character.

    Do not use this when reading data sets.

  • I=UNIX: The line delimiter on the connection is LF (\n, 0x0A).

  • I=DOS: The line delimiter on the connection is CRLF (\r\n, 0x0D 0x0A).

  • I=MAC: The line delimiter on the connection is CR (\r, 0x0D).

  • I=NEL: The line delimiter used in the file is Unicode New Line (0x85).

Default: none

[Note]Note

The line delimiter information should be given to the host that is capable of performing the conversion, like a host with a Tectia.

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, 0x15). When writing to a data set, also the CR (\r, 0x0D) code is considered as the End of Line.

  • J=MVS-FTP: When reading MVS data sets, each record in the data set is treated as a line. The transfer line delimiter is appended to the record. Any control characters in the record data are preserved.

    When reading data sets with printer control characters, the control characters are preserved in the output.

    If code set conversion is specified either by parameter E|transfer_translate_table, or by parameters C|transfer_codeset and D|transfer_file_codeset, the appended delimiter is the delimiter specified by I|transfer_line_delimiter, C|transfer_codeset, or E|transfer_translate_table. If no code set conversion is requested, the delimiter is defined by the code set of the data set. By default it is EBCDIC.

    You can specify code sets by defining transfer_file_codeset without transfer_codeset. For example, to have a DOS delimiter in Unicode (x'000D000A') appended to the records, set "I=DOS,J=MVS-FTP,D=UCS-2", and to have a Unix delimiter in ISO Latin 1 (x'0A'), set "I=UNIX,J=MVS-FTP,D=ISO8859-1".

    Do not use this when writing data sets.

  • J=UNIX: The line delimiter used in the file is LF (\n, 0x0A).

  • J=DOS: The line delimiter used in the file is CRLF (\r\n, 0x0D 0x0A).

  • J=MAC: The line delimiter used in the file is CR (\r, 0x0D).

  • J=NEL: The line delimiter used in the file is Unicode New Line (0x85).

Default: none

[Note]Note

The line delimiter information should be given to the host that is capable of performing the conversion, like a host with a Tectia.

Line delimiter conversion is implemented for single byte code sets only.

For the line delimiter conversion to happen, both transfer_line_delimiter and transfer_file_line_delimiter must be specified.

In the following example, a z/OS Tectia SFTP client sends a data set to a Windows host and copies the file back from Windows. The code set is also converted:

sftp> sput /ftadv:I=DOS,J=MVS,C=ISO8859-1,D=IBM-1047/__DATASET.TXT file.txt
sftp> sget file.txt /ftadv:I=DOS,J=MVS,C=ISO8859-1,D=IBM-1047/__DATASET.TXT \ 
      file.txt

In the sput command, with the file line delimiter conversion (J=MVS), the z/OS client inserts an NL (0x15) character after each record. The line delimiter conversion (I=DOS) converts all NL:s to CRLF (0x0D 0x0A) characters, which remain unchanged in the code set conversion. The z/OS client is told that the code set in the data set is IBM-1047 and it should be converted to ISO8859-1 before transferring the data to the Windows server.

In the sget command, the CRLF line delimiters (set by I=DOS) are converted to LF characters (J=MVS), which are converted to NL characters in the code set conversion. The conversion from line-delimited stream format to record-oriented format occurs automatically. In the code set conversion, the z/OS client is told that the file has the ISO8859-1 code set during the transfer and the data set should be stored with the IBM-1047 code set.

keylen=LENGTH

Specifies the length in bytes of the keys used in the data set.

Default: none

keyoff=OFFSET

Specifies the key offset; the position of the first byte of the key in records of the specified VSAM data set.

Default: none

L|size=SIZE

Size estimate (in bytes) for data set allocation.

Default: 1000000

label_type=SL|NSL|SUL|LTM|AL|AUL

The type of the label for the data set. This attribute corresponds to the first value in the LABEL parameter of the JCL DD statement.

[Note]Note

The values NL (no label) and BLP (bypass label processing), which can be specified in JCL, are not allowed for this attribute in Tectia.

like=LIKE

Specifies the name of a model data set from which the RECFM, BLKSIZE, and LRECL attributes are to be copied. The name must be the full DSN of a cataloged data set and must be preceded with three underscores.

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

Default: none

M|directory_size=SIZE

Specifies the number of 256-byte records in the directory.

Default: 10

mgmtclas=CLASS

Specifies the management class of a data set.

Default: none

NOAUTOMount

Equal to automount=NO.

NOAUTORecall

Equal to autorecall=NO.

normdisp=CATLG|UNCATLG|KEEP|DELETE

Specifies the data set disposition to be used after a file transfer that ends normally. This attribute corresponds to the second value in the DISP parameter of the JCL DD statement.

Default: CATLG

O|recfm=RECFM

RECFM specifies the data set organization. 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_space=SPACE

Primary space allocation for a data set.

Default: none

R|lrecl=LENGTH

Maximum record length or fixed record length.

Default: 4096, for VSAM, 80, if data set organization is F or FB, otherwise 1024.

retention_period=DAYS

The retention period in days. After the retention period, the data set expires and the operating system can delete or overwrite the data set.

Default: System default

S|staging=NO|YES

Specify whether staging is to be used in the SFTP server when accessing a file or data set.

If set to NO, staging is not used.

If set to YES, staging is used, when needed.

If this parameter is not set, the server decides whether staging will be used or not.

secondary_space=SPACE

Secondary space allocation for a data set.

Default: none

space_unit=UNIT

Unit of space allocation for a data set.

Possible values for the space allocation unit are:

  • BLKS: Blocks

  • CYLS: Cylinders

  • TRKS: Tracks

  • AVGRECLEN: 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

storclas=CLASS

Specifies the storage class of system managed storage.

Default: none

svc99_text_units=STRING

Dynamic allocation arguments that override or are added to arguments from other file transfer attributes. For detailed information on this attribute, see Low-Level Access.

Default: none

T|type=TYPE

Specifies the type of a data set when the data set is created. The available values are:

  • T=HFS: The type of the created data set is HFS.

  • T=PO|PDS: The type of the created data set is PDS.

  • T=POE|PDSE: The type of the created data set is PDSE.

  • T=VSAM: The type of the created data set is VSAM.

  • T=ESDS: The type of the created data set is VSAM ESDS.

  • T=KSDS: The type of the created data set is VSAM KSDS.

  • T=RRN: The type of the created data set is VSAM RRN.

  • T=PS: The type of the created data set is PS.

  • Default: PO, if data set name includes member, otherwise PS

TRacks

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

trailing_blanks=YES|NO

Specifies whether to preserve trailing blanks in a transferred data set.

If set to YES, trailing blanks will be transferred. This can be used, for example, to preserve the structure of fixed format data sets when transferring to a Unix-type file system.

If set to NO, trailing blanks will be stripped.

Default: NO

[Note]Note

This option only applies to line-delimited target files (transfer_format=LINE), not to target unit-record data sets.

U|record_truncate=YES|NO

When a record truncation occurs while writing an MVS data set, the system will continue writing the data set 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 code set and line delimiter conversion) is larger than the maximum record length of the data set. 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 data set record depends on the data set organization:

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

When Tectia client tools for z/OS aborts writing a data set 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 data set is left on the system.

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 data set 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 Tectia client tools for z/OS writes a data set with record_truncate=YES, data loss may occur.

unit=UNIT

The name of the device or group of devices that the data set 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

unit_count=NUMBER

Specifies the number of devices for the data set. This attribute corresponds to the second value in the UNIT parameter of the JCL DD statement.

Default: System default

unit_parallel=YES|NO

Asks the system to mount all the volumes for the data set in parallel. This attribute corresponds to the character 'P' in the second value in the UNIT parameter of the JCL DD statement.

Default: System default

volumes=VOLUMES

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

Default: none

volume_count=NUMBER

Specifies the maximum number of volumes that an output data set requires. This attribute corresponds to the volume count value in the VOLUME parameter of the JCL DD statement.

Default: System default

X|transfer_mode=MODE

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

  • X=BIN: Code set and line delimiter conversions are not performed.

  • X=TEXT: Code set 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.

Example Advice Strings

The following examples show advice strings for various situations.

Example 1

Below is an example of a file name that requests the transfer of a PDS member with the line transfer format and code set conversion from EBCDIC to an ASCII code set.

/ftadv:D=IBM-1047,C=ISO8859-1,F=line/__personal.cntl/idlist
Example 2

The following example requests the transfer of a data set with the line transfer format and code set conversion using the translate table USR1.SFTP.TCPXLBIN, if it exists, or TCPIP.SFTP.TCPXLBIN. Different combinations of underscore and slash ("__", "_/", "/_", or "//") in front of the file name indicate that the file is an MVS data set.

/ftadv:F=line,E=SFTP,A=___USR1.%T.TCPXLBIN+___TCPIP.%T.TCPXLBIN/__DATA1.FILE1
Example 3

The example below names an HFS file to be transferred without changes. Transfer mode is set to binary (X=bin) to avoid conversion and to override any defaults set in the matching file transfer profiles or environment files.

/ftadv:X=bin,T=HFS,F=stream/profcopy
Example 4

The next example uses the named file transfer profile myprofile. The advice string also sets the data set code set to ISO8859-15. This value overwrites the value specified in the profile.

/ftadv:P=myprofile,D=iso8859-15/testfile
[Note]Note

Advice strings can also be used with directory names in file transfer GUIs. With advice strings, file transfer can be controlled in the GUI. For example in the Windows GUI, if you use the directory /ftadv:P=WIN/_path/to/current/directory/, all file transfers to and from the directory /path/to/current/directory use the advice string /ftadv:P=WIN/. This means that all file transfers use the named profile WIN (see File Transfer Profiles).

[Note]Note

Advice string parameters are case-insensitive, with the exception of file transfer profile names. For example, P=win and P=WIN point to different profiles.

Example 5

This example uses the LIKE attribute when creating an MVS PS data set with the name "userid.TEST.CPY1". The server copies RECFM, LRECL, and BLKSIZE from the PDS "COMP.DATA.CNTL".

/ftadv:like=___COMP.DATA.CNTL,T=PS/__TEST.CPY1

This example uses the LIKE attribute when creating a PDSE, "COMP.CODE". The record characteristics are copied from a PDS, "COMP.SOURCE". The PDSE is created when adding the first member, PRG1. The new PDS is estimated to need 15 MB space.

/ftadv:like=___COMP.SOURCE,T=POE,size=15000000/____COMP.CODE(PRG1)