File Name Tokens

You can use file name tokens to name transferred files or to match files that you want to transfer on either a responder (server) or an initiator (client).

A string of tokens are characters that contain a mixture of literal and substitution values. You can use file name tokens to format file names based on date, time, user information and so on. Therefore, instead of entering a standard file name, you can enter a name that consists of tokens.

There is one special token: *.

  • If you perform a cfsend and include a * on the remote file name, the cfsend command will substitute the local file name for the *.
  • If you perform a cfrecv and include a * on the local file name, the cfrecv command will substitute the remote file name for the *.

The format of the file name using the token is $(tokenname). All tokens are converted before being sent to the remote system, except for RemoteTransactionNumber.

Note: When you use the dollar sign ($) or the backward slash sign (\) on the command line, some UNIX systems might require a backslash (\) before these signs. Optionally, you can put single quotes around the entire parameter that contains the token. Tokens are case-sensitive. A list of file name tokens can be displayed by the cfsend or cfrecv commands by entering the following commands:

cfsend /htoken

cfrecv /htoken

The following table shows the file name tokens that are supported:

Token name Description Generated Value
$(LocalFile) Local file name tokens are used by the cfsend command in the remotefilename parameter. For example:
  • Local file:

/home/usr/temp/files/testfile1.txt

  • Remote file:

c:\target\$(LocalFile)

Resolution: testfile1.txt

$(LocalFileBase)

Local file name only.

For example:

  • Local file:

/home/usr/temp/files/testfile1.txt

Remote file: c:\target\$(LocalFileBase)

Resolution: testfile1.txt.

$(LocalFileExt)

Extension of the local file. For example:
  • Local file:

/home/usr/temp/files/testfile1.txt

  • Remote file:

c:\target\$(LocalFileExt)

Resolution: testfile1.txt.

$(LocalFileName)

Local file name including the extension. For example:
  • Local file:

/home/usr/temp/files/testfile1.txt

  • Remote file:

c:\target\$(LocalFileName)

Resolution: testfile1.txt.
Note: You must use the full path of the remote file, otherwise, the file might be transferred to the $CFROOT directory.
$(LocalFL##) File qualifier computed from left-justified position specified by ##. For example:
  • Local file:

/home/usr/temp/files/testabc.aaa.bb.c.txt

  • Remote file:

c:\target\$(LocalFL01)

Resolution: testabc.
$(LocalFR##) File qualifier computed from right-justified position specified by ##. For example:
  • Local file:

/home/usr/temp/files/testabc.aaa.bb.c.txt

  • Remote file:

c:\target\$(LocalFR01)

Resolution: testabc.aaa.bb.c.txt.

$(NoLocalFileBase)

Local file name excluding the base name. For example:
  • Local file:

/home/usr/temp/files/a.b.c.txt

  • Remote file:

c:\target\$(NoLocalFileBase)

Resolution: a.b.c.txt.

$(NoLocalFileExt)

Local file name excluding the extension. For example:
  • Local file:

/home/usr/temp/files/a.b.c.txt

  • Remote file:

c:\target\$(NoLocalFileExt)

Resolution: a.b.c.txt.

$(LocalUserId)

Local user ID being used for the file transfer. For example:
  • Local user ID: TESTLAB\cfuser1
  • Local file:

/home/usr/temp/files/testfile1.txt

  • Remote file:

c:\target\file1$(LocalUserId).txt

Resolution: d:\target\file1cfuser1.txt.
$(RemoteFile) Remote file name tokens used by the cfrecv command in the localfilename parameter. For example:
  • Local file:

/home/usr/temp/$(RemoteFile)

  • Remote file:

c:\source\directory\testfile1.txt

Resolution: testfile1.

$(RemoteFileBase)

The base name of the remote file. For example:
  • Local file:

/home/usr/temp/$(RemoteFileBase)

  • Remote file:

c:\source\directory\testfile1.txt

Resolution: testfile1.

$(RemoteFileExt)

Extension of the remote file. For example:
  • Local file:

/home/usr/files/$(RemoteFileExt)

  • Remote file:

c:\source\directory\testfile1.txt

Resolution: testfile1.txt

$(RemoteFileName)

Remote file name including the extension. For example:
  • Local file:

/home/usr/files/$(RemoteFileName)

  • Remote file:

c:\source\directory\testfile1.txt

Resolution: testfile1.txt
Note: You must use the full path of the remote file, otherwise, the file might be transferred to the $CFROOT directory.
$(RemoteFL##) The file qualifier computed from left-justified position specified by ##. For example:
  • Local file:

/home/usr/files/$(RemoteFL01)

  • Remote file:

c:\source\directory\testabc.aaa.bb.c.txt

Resolution: testabc.
$(RemoteFR##) The file qualifier computed from right-justified position specified by ##. For example:
  • Local file:

/home/usr/files/$(RemoteFR01)

  • Remote file:

c:\source\directory\testabc.aaa.bb.c.txt

Resolution: testabc.aaa.bb.c.txt.

$(RemoteUserId)

Remote user ID used in the file transfer. For example:
  • Remote user ID: TEST\cfuser1
  • Local file:

/home/usr/files/file1.$(RemoteUserId).txt

  • Remote file:

c:\source\directory\testfile1.txt

Resolution: /home/usr/files/file1.cfuser1.txt

$(RemoteTransactionNumber)

Remote transaction number. For example:

Local file:

/home/usr/temp/files/testfile1.txt

Remote file:

c:\target\$(RemoteTransactionNumber)
.testfile1.txt

Resolution like: RA18100052.testfile1

$(NoRemoteFileBase)

Remote file name excluding the base name. For example:
  • Local file:

/home/usr/temp/files$(NoRemoteFileBase)

  • Remote file:

c:\source\directory\a.b.c.txt

Resolution: a.b.c.txt

$(NoRemoteFileExt)

Remote file name excluding the extension. For example:
  • Local file:

/home/usr/temp/files$(NoRemoteFileBase)

  • Remote file:

c:\source\directory\a.b.c.txt

Resolution: a.b.c.txt
$(Date) Local date. YYYYMMDD
$(Date1) Local date. YYMMDD
$(Date2) Local date. MMDDYY
$(Date3) Local date. DDMMYY
$(DateUS) Local date. MMDDYYYY
$(YDate) Yesterday's date. Local Date YYYYMMDD - 1 day
$(YDateUS) Yesterday's date inthe US format.

Local Date MMDDYYYY - 1 day

$(SDD) The date or day of the month to be specified. The valid values are from 01 to 31. For example: 05 for the fifth day of the month
$(SJ) The Julian day(ddd). For example: 320
$(SMON) The month of the year to be specified using the first three letters and upper case. For example: JAN for the month of JANUARY
$(SMon) The month of the year to be specified using the first three letters and lower case. For example: Jan for the month of January
$(SMM) The month of the year to be specified as a number. The valid values are from 01 to 12. For example: 02 for the month of February
$(SYYYY) The year to be specified using 4 digits. The valid values are from 0000 to 9999. For example: 2018
$(SYY) The year to be specified using the last two digits of the year. The valid values are from 00 to 99. For example: 18 for the year 2018
$(Time) Local time. HHMMSSMSS
$(Time1) Local time. HHMMSS
$(Time2) Local time. HHMMSST

$(TransactionNumber)

Local transaction number. For example:
  • Local file:

/home/usr/temp/files/testfile1.txt

  • Remote file:

c:\target\$(TransactionNumber).testfile1.txt

Resolution like:IA18100117.testfile1.txt
$(UserData) The user data defined by the cfsend or cfrecv commands. For example:

cfsend .... ud:AcctFile

The resolution to this token is AcctFile.