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, thecfsend
command will substitute the local file name for the *. - If you perform a
cfrecv
and include a * on the local file name, thecfrecv
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.
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:
/home/usr/temp/files/testfile1.txt
c:\target\$(LocalFile) Resolution: |
|
Local file name only. |
For example:
/home/usr/temp/files/testfile1.txt Remote file: Resolution: testfile1.txt. |
|
Extension of the local file. | For example:
/home/usr/temp/files/testfile1.txt
c:\target\$(LocalFileExt) Resolution: testfile1.txt. |
$(LocalFileName) |
Local file name including the extension. | For example:
/home/usr/temp/files/testfile1.txt
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:
/home/usr/temp/files/testabc.aaa.bb.c.txt
c:\target\$(LocalFL01) Resolution: testabc. |
$(LocalFR##) | File qualifier computed from right-justified position specified by ##. | For example:
/home/usr/temp/files/testabc.aaa.bb.c.txt
c:\target\$(LocalFR01) Resolution: testabc.aaa.bb.c.txt. |
|
Local file name excluding the base name. | For example:
/home/usr/temp/files/a.b.c.txt
c:\target\$(NoLocalFileBase) Resolution: a.b.c.txt. |
$(NoLocalFileExt) |
Local file name excluding the extension. | For example:
/home/usr/temp/files/a.b.c.txt
c:\target\$(NoLocalFileExt) Resolution: a.b.c.txt. |
$(LocalUserId) |
Local user ID being used for the file transfer. | For example:
/home/usr/temp/files/testfile1.txt
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:
/home/usr/temp/$(RemoteFile)
c:\source\directory\testfile1.txt Resolution: testfile1. |
$(RemoteFileBase) |
The base name of the remote file. | For example:
/home/usr/temp/$(RemoteFileBase)
c:\source\directory\testfile1.txt Resolution: testfile1. |
$(RemoteFileExt) |
Extension of the remote file. | For example:
/home/usr/files/$(RemoteFileExt)
c:\source\directory\testfile1.txt Resolution: testfile1.txt |
|
Remote file name including the extension. | For example:
/home/usr/files/$(RemoteFileName)
c:\source\directory\testfile1.txt Resolution: testfile1.txtNote: 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:
/home/usr/files/$(RemoteFL01)
c:\source\directory\testabc.aaa.bb.c.txt Resolution: testabc. |
$(RemoteFR##) | The file qualifier computed from right-justified position specified by ##. | For example:
/home/usr/files/$(RemoteFR01)
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:
/home/usr/files/file1.$(RemoteUserId).txt
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:
|
$(NoRemoteFileBase) |
Remote file name excluding the base name. | For example:
c:\source\directory\a.b.c.txt Resolution: a.b.c.txt |
$(NoRemoteFileExt) |
Remote file name excluding the extension. | For example:
/home/usr/temp/files$(NoRemoteFileBase)
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:
/home/usr/temp/files/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. |