Sending a group of files

You can use the FNAME parameter in a SEND command, when prefixed with the <file_symb> indirection character, to trigger SEND operations that correspond to:

  • A list of file names in an indirection file (SEND FNAME = #LIST for example) in heterogeneous mode only
  • A series of files indicated by a generic name (SEND FNAME = #FIL* for example) or a directory name (SEND FNAME = #DIRECTORY\*)
    • In homogeneous mode
    • In heterogeneous mode
    • Using a file name filter
Note If FNAME designates a generic name and the <file_symb> indirection character is omitted, SEND FNAME = FIL* for example, the SEND command triggers a single transfer, in which pseudo-records each of which corresponds to a file name are sent.

Use an indirection file

You can use a list of file names to send a group of files using the indirection file structure as follows:

  • A record can contain only one file name
  • A file name must begin in the first column
  • The file can contain empty records
  • The file name cannot contain an asterisk (*)

Example

For a file called REPORTS containing the following list:

  • file1
  • file2
  • file3

Windows

CFTUTIL SEND part=tokyo, idf=myfiles, fname=#REPORTS

UNIX

CFTUTIL SEND part=tokyo, idf=myfiles, fname=@REPORTS

The files file1, file2 and file3 will be sent.

Note You cannot use a file name with an asterisk, for example fil*, as that denotes the beginning of a file not a directory.

If there are N files to be sent, a SEND IDF = ID_EM, FNAME = #GROUP (or @GROUP) ... command generates N+1 transfer entries in the catalog, as follows:

  • One entry for each file transfer (that is N entries)
  • A generic (virtual) entry, which never triggers an actual transfer but is used locally to manage the group of files to be sent
    • This virtual transfer is identified by a DIAGP code set to LIST_FI, when the catalog is queried. Its state is immediately set to K in the catalog.
    • The generic entry is set to the T or X state when all transfers have been set to T state (or X depending on the mode).
    • The post-processing procedure is activated when all files in the group have been transferred (LIST_FI entry set to the T or X state, depending on the mode).
    • If the group file does not exist or cannot be opened, the generic entry remains set to the K state and error message CFTT34E is returned.
    • If one of the files in the group cannot be sent (for example an unknown file), the other transfers are not affected, but the generic entry for the group is not set to the T state (or X depending on the mode).
Note See also COMPAT mode, if using backward compatibility.

For the receiver:

  • A catalog entry is created for each file received
  • The name of each file can be specified using the &FPATH, &FROOT and &FSUF symbolic variables
Note You can specify a list of directories to be sent in the indirection file. However, do not mix files and directories in the same indirection file.

Additional policies for group-of-files transfers

If you execute a SEND transfer request for a group of files that uses a sequential file as input, it creates as many transfer requests as there are lines in the input file, possibly causing the catalog to overfill.

To avoid this you can use the CFTPARM parameter SNDINDFILEERR to define the policy for a group of files type of transfer to address this issue if there is an error.

Parameter values:

  • CONTINUE (default): Keep the existing behavior, which creates as many transfer requests as there are lines in the input file.
  • ABORT: If the input file line is not a file, this gives the current transfer the status K diagi 132 diagp SNDINDFI, the generic transfer status is K diagi 200, and no other child requests are created.

Catalog details

Simplified catalog view when set to CONTINUE

Transfer type IDTU PIDTU Phasestep Diagi
Parent 1   H 0
Child 2 1 K 110
Child 3 1 C 0
Child N 1 C 0

Simplified catalog view when set to ABORT

Transfer type IDTU PIDTU Phasestep Diagi
Parent 1   H 200
Child 2 1 K 132

Use generic name files

To send a group of generic files, use the command:

SEND FNAME=#mask or SEND FNAME=#dirname

Where the FNAME parameter is set to one of the following values:

  • A directory name, dirname, in which case all files accessible in the directory are to be sent
  • A generic name, mask, including wildcard characters, in which case only the selected files are to be sent
  • A directory name and a generic file name, in which case only the files selected in the directory are to be sent

The processing performed is of two types, depending on the operating system of the remote site. Sites are said to be mono-platform when the same operating system is used by both partners.

Types of group file transfers

There are two types of send procedures for groups of files: homogeneous and heterogeneous. These procedure types are described in detail further on in this topic.

Homogeneous send for a group of files

A homogeneous send occurs between two Transfer CFT that run on the same operating system (Windows, Unix, z/OS, IBM i, and HP Nonstop). This transfer procedure concatenates at the site sending the group of files and de-concatenates upon reception. The wfname is mandatory for transmission and reception in homogeneous sends, because the file resulting from the concatenation is the file that is sent.

Note Transfer CFT OpenVMS does not support sending a group of files in homogeneous mode.
Platform UNIX-like environment Native
z/OS Not supported Available
IBM i Not supported Available
HP Nonstop Available Not supported
OpenVMS Not applicable Not supported

Heterogeneous send for a group of files

A heterogeneous send occurs between two Transfer CFT that run on dissimilar operating systems. This type of group file transfer triggers the transfer of all files belonging to the group.

General syntax

Windows: fname =#directory\*

Unix: fname =@directory/*

Example

In Windows an example of a homogeneous send:

cftsend id = copie,
fname = #c:\e\cft320\tmp\a*,
wfname = c:\e\cft320\&idtu.snd,
frecfm = v, ftype = b,
mode = create
cftrecv id = copie,
fname = c:\cft320\bin\recv,
faction = delete,
wfname = &idtu.rcv,
ftype = b

See also Forcing heterogeneous group file transfers.

Sending to a remote site in homogeneous mode

Note The following is valid when using the same system type and heterogeneous mode is not forced. When using Central Governance remember that heterogeneous mode is the default setting.

The files to be transferred are copied and concatenated in a work file that must be specified in the WFNAME parameter of the send command.

On the sender side, two entries are created in the catalog:

  • A generic entry (LIST_FI) with the following attributes:
    • FNAME = {dirname | mask}
    • and WFNAME = temp-filename

Its state is immediately set to K, once it has been created in the catalog. This entry is set to the T (or X) state when all transfers have been set to T (or X depending on the compatibility mode).

  • A transfer entry with the following attributes:
    • FNAME = temp-filename
    • WFNAME = {dirname | mask}

On the receiver side, a single transfer entry is created. The data is received in the work file that must be specified in the WFNAME parameter and de-concatenated in the directory specified in the FNAME parameter of the receive command.

Once the transfer has been completed, the work file is deleted by each of the relevant partners. If the transfer is interrupted however, the associated WFNAME work file is not deleted. It will only be removed when the transfer has been restarted and successfully completed or the associated catalog entry has been deleted.

The file attributes defined for the transfer (RECV command) apply to the copied/concatenated WFNAME file.

Sending to a remote site

Sending to a remote site with a different operating system in heterogeneous mode

The copy/concatenation operation is not performed for a remote site with a different operating system, i.e. a heterogeneous send. If the WFNAME parameter is set in the send command, it is ignored.

The sender creates the following entries:

  • One transfer entry for each file selected after analyzing the generic request
  • A generic entry identified by the DIAGP code set to LIST_FI. Once it has been created in the catalog, its state is immediately set to K. The state is changed to T (or X) when all related transfers are set to T (or X, depending on the compatibility mode).

The EXECSF end of transfer procedure is activated when all selected files have been transferred. If one of the files concerned by the generic transfer cannot be sent, the other transfers are in no way affected, but the generic entry is not set to the T state (or X, depending on the compatibility mode).

On the receiver side, one transfer entry is created for each file received.

For operating reasons, the receiving Transfer CFT may wish to archive each file received using a name derived from that of the sender site. The following paragraphs explain how the sending Transfer CFT can send the name of each file transferred to the partner via a generic request.

A receiving Transfer CFT can specify the name of each file received via the &FROOT, &FPATH and &FSUF symbolic variables.

Sending to a remote site with a different operating system

See also Forcing heterogeneous group file transfers

Create filters using CFTSEND

You  can use the CFTSEND FILTER and FILTERTYPE parameters to apply file filtering based on the FNAME.

Example

Create a filter that includes all .jpg files that are:

  • A word (at least one other word character)
  • Followed by four-digit number

Heterogeneous mode

For example, a transfer from a Unix platform to Windows, the following filter would include all of the files in "myfolder" that match the pattern described above such as the file IMGP0122.jpg.

 CFTSEND ID = 'findfile',

 FILTERTYPE = 'EREGEX',

 FILTER = '^[0-9a-zA-Z]+[0-9]{4}.jpg'

...

 

SEND PART = PARIS,

 IDF = 'findfile',

 FNAME = '@myfolder/*'

...

For example on a z/OS platform, the following filter would include the files AXDSYN.TOOLS.GRPFIL. or GRPFIM. followed by A4 or A5:

CFTSEND ID = 'TREGEX03',

FILTERTYPE = 'EREGEX',

FILTER = '^-[\.]+*\.-[^\.]+*\.GRPFI(L|M).A(4|5)\.'

...

 

SEND PART = PARIS,

IDF = 'TREGEX03',

FNAME = '#AXDSYN.TOOLS.*'

The FILTERTYPE can be either STRJCMP or EREGEX, used as described further on in this topic.

Homogeneous mode

For example, a transfer between Unix platforms, the following filter would include all of the files in "myfolder" that match the pattern described above such as the file IMGP0122.jpg.

 CFTSEND ID = 'findfile',

 FILTERTYPE = 'EREGEX',

 FILTER = '^[0-9a-zA-Z]+[0-9]{4}.jpg'

...

 

SEND PART = PARIS,

 IDF = 'findfile',

 FNAME = '@myfolder/*'

WFNAME = '&idtu.tmp'

...

STRJCMP filter

A STRJCMP pattern-matching filter can contain the asterisk (*) and/or the question mark (?) characters. The STRJCMP filter characters are interpreted as follows:

Character Description Example
* Indicates any sequence of zero or more characters. The filter "*.dat" selects any file name that has the extension ".dat".
? Indicates any single character. The filter "T*.???" selects any file name starting with a 'T' and having an extension of exactly three characters.

EREGEX filter

EREGEX (extended regular expressions) is the use of special characters and strings to define a search pattern. In Transfer CFT, you can use these search patterns to create filters.

In POSIX-Extended regular expressions, all characters match themselves meaning they match a sub-string anywhere inside the string to be searched. For example abc, matches abc123, 123abc, and 123abcxyz. Some symbols are exceptions though; commonly used symbols and example usages are listed in the following table.

Symbol Indicates Example
. Any character except newline (line break) a.c matches abc
[ ] Or [def] means d or e or f
{} Exactly {3} means exactly three
() Capture group pand(ora|467) matches pandora OR pand467
* 0 or more occurrences of the preceding element

ab*c matches ac, abc, abbc, abbbc, and so on

+ 1 or more occurrences of the preceding element ab+c matches abc, abbc, abbbc, and so on, but not ac
? Zero or one occurrence of the preceding element plurals? matches plural
| Alternation (matches either the right side or the left) / OR operand ab|cd|ef matches ab or cd or ef
^ Start of a string ^a matches any file that starts with an a
[^ ...] Any single character that is not in the class [^/]* matches zero or more occurrences of any character that is not a forward-slash, such as http://
$ End of string .*? the end$ matches this is the end
Note EREGEX refers to POSIX Extended Regular Expression. There are multiple tutorials available online to aid in creating search patterns; for additional information on expression syntax please refer to Regular expressions.

Related Links