For examples of how you might use these commands, see Command Examples.
Common commands
The following commands are available across all supported Endpoints.
CLEAR
Clear a property string value. The cleared value only affects the commands that follow the CLEAR.
CLEAR property
- property
- Property name with no embedded spaces.
Comment
# text...
Lines starting with a # character are considered comments and will be ignored when the dataflow executes. Lines starting with # are generally used for documentation purposes.
SET
Change a property value. The new value only affects the commands that follow the SET.
SET property=value
- property = value
- Property and new value
- The property name must have no embedded spaces.
- The value specified remains in effect until it is set again or until the end of the dataflow.
- To reset the property back to default value, specify
SET property
or
SET property=
Valid properties for SET command are as follows:
- host.Path.PUT=xxx
- Valid only for AS2 Endpoints.
- Use this property to override the resource path in the Endpoint's Partner URL when multiple resource paths are used for the same partner.
- PostGetCommand
- PostPutCommand
- Valid only for FTP and SFTP Endpoints.
- Use these properties to specify commands to be executed only after a successful GET or PUT, respectively.
- PreGetCommand
- PrePutCommand
- Valid only for FTP and SFTP Endpoints.
- Use these properties to specify commands to be executed before a GET or PUT, respectively. This has the benefit of keeping the log results relative to just GETs and PUTs. In addition, for the PUT, it avoids connecting and logging into the server when there are no files to send.
- PrePutCommandForFirstFileOnly
- Valid only for FTP and SFTP Endpoints
- Use this property to specify commands to execute before a PUT only before the first file transfer.
- RetrieveDirectorySort
- Valid only for FTP and SFTP Endpoints
- Use this property to control the order in which files are downloaded from the server. Possible values include:
- Alphabetical (ascending)
- Alphabetical (descending)
- Date/Time Modified (ascending)
- Date/Time Modified (descending)
- Size (ascending)
- Size (descending)
WAIT
Pause execution.
WAIT seconds
- Seconds
- Number of seconds to pause.
AS2 Endpoint commands
The following commands are available for AS2 Endpoints.
PUT
Send one or more files to the host.
PUT "source" "destination"
- source
-
- Source is a filename.
- You can use
*
and?
, or a regular expression when you specify a filename. See Using Wildcards and Regular Expressions in CIC for additional information. - You can use macro variables. See Using Macro Variables in CIC (Source context) for a list of the applicable macros.
- If the source contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
- destination
-
Remote destination filename. If the destination contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("..."). The use of macro variables is supported. See Using Macro Variables in CIC (Destination context) for a list of the applicable macros.
SET
Override the resource path in the Endpoint's Partner URL when multiple resource paths are used for the same partner
SET host.Path.PUT=xxx
FTP Endpoint commands
The following commands are available for FTP Endpoints.
CD
Changes the current working directory on the host.
CD "directory"
- directory
- The new working directory.
DIR
Get a directory listing of available files from the host
DIR "source"
- source
-
Remote source directory path
GET
Receive one or more files from the host
GET [-ASC|-BIN] [-REC] [-DEL] "source" "destination"
- ASC
- Transfer file in ASCII format.
- BIN
- Transfer file in Binary format.
- REC
- Recursively retrieve nested subdirectories.
- DEL
- If GET is successful, delete remote file.
- source
-
Remote source path
- destination
-
CIC destination. The use of macro variables is supported. See Using Macro Variables in CIC (Destination context) for a list of the applicable macros.
- Path can be to a filename or to a directory.
- The use of macro variables is supported. See Using Macro Variables in CIC (Destination context) for a list of the applicable macros.
PUT
Send one or more files to the host.
PUT [-ASC|-BIN][-UNI|-APE] "source" "destination"
- ASC
- Transfer file in ASCII format
- BIN
- Transfer file in Binary format
- UNI
- Ensure remote filename unique
- APE
- Append to the existing destination file
- source
-
Source path
- path can be to a filename or to a directory
- * and ?, or a regular expression, are supported in filename. See Using Wildcards and Regular Expressions in CIC for additional information.
- usage of macro variables is supported. See Using Macro Variables in CIC (Source context) for a list of the applicable macros.
- destination
-
Remote destination path. The use of macro variables is supported. See Using Macro Variables in CIC (Destination context) for a list of the applicable macros.
QUOTE
Send a raw command to the FTP server
QUOTE "command"
- command
- Command to be sent to the server. (Example: PWD, CWD, DELE) See the FTP RFC 959 for more details on specific FTP commands.
SITE
Sends a site-specific command to the server.
SITE "command"
- command
- Site specific command with any arguments
TYPE
Set the default data type for file transfers.
TYPE "data type"
- data type
- ASCII or Binary
SFTP Endpoint commands
CD
Changes the current working directory on the host.
CD "directory"
- directory
- The new working directory.
CHGRP
Changes the group ID of the file or directory on the host.
QUOTE CHGRP group "path"
- group
- The numeric group id for the new group.
- path
- The path to the remote file/directory. If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
CHMOD
Changes the access permissions or modes of the file or directory on the host.
QUOTE CHMOD permissions "path"
- permissions
- The absolute mode of the file/directory. Absolute modes are octal numbers specifying the complete list of attributes for the files; you specify attributes by OR'ing together these bits.
0400
- Individual read0200
- Individual write0100
- Individual execute (or list directory)0040
- Group read0020
- Group write0010
- Group execute0004
- Other read0002
- Other write0001
- Other execute
- path
- The path to the remote file/directory. If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
CHOWN
Changes the user ID of the file or directory on the host.
QUOTE CHOWN owner "path"
- owner
- The numeric user id for the new owner.
- path
- The path to the remote file/directory. If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
DIR
Get a directory listing of available files from the host.
DIR "source"
- source
- Remote source directory path. If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
GET
Receive one or more files from the host
GET -REC –DEL "source" "destination"
- REC
- Recursively retrieve nested subdirectories.
- If used in conjunction with
–DEL
, the retrieved files, but not subdirectories, are deleted on the server.
- If used in conjunction with
- DEL
- If the GET is successful, delete the remote file.
- source
- Remote source path. If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
- destination
- CIC destination path.
- Path can be to a filename or to a directory.
- You can use macro variables. See Using Macro Variables in CIC (Source context) for a list of the applicable macros.
- If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
PUT
Send one or more files to the host.
PUT -APE "source" "destination"
- APE
- Append copied file to an existing destination file.
- source
- CIC source path
- Path can be to a filename or to a directory
- You can use
*
and?
, or a regular expression when you specify a filename. See Using Wildcards and Regular Expressions in CIC for additional information. - You can use macro variables. See Using Macro Variables in CIC (Source context) for a list of the applicable macros.
- If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
- destination
- Remote destination path.
- You can use macro variables. See Using Macro Variables in CIC (Destination context) for a list of the applicable macros.
- If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
MKDIR
Creates a new directory on the host.
QUOTE MKDIR "directory"
- directory
- The name of the new directory. If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
MKDIRS
Creates new directories on the host.
QUOTE MKDIRS "path"
- path
- The path of directories to create. Subdirectories are created using the
/
delimiter. If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
PWD
Returns the name of the current working directory on the host.
QUOTE PWD
RENAME
Renames a file or directory on the host.
QUOTE RENAME "source" "destination"
- source
- The source file/directory to rename. If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
- destination
- The destination file/directory name. If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
RM
Removes a file on the host.
QUOTE RM "path"
- path
- The path of the file to remove. If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
RMDIR
Removes a directory on the host.
QUOTE RMDIR "path"
- path
- The path of the directory to remove. If the path contains a space, dash (-), comma (,), or equal sign (=), it must be enclosed with double quotes ("...").
Command Examples
SET with PostGetCommand example
The following SFTP-specific example shows how to use the SET command to set the PostGetCommand property, which specifies a command to be executed only after a successful GET. In this case, the PostGetCommand property specifies a QUOTE command, which in this case sends a raw RENAME command to FTP to move the file to the HISTORY directory.
SET PostGetCommand=QUOTE RENAME ${sourcefile} HISTORY\${sourcefilebase}${sourcefileext}
CD order
GET *.ord
So when these commands run, we CD to the order directory, GET files with the .ord extension, and if the GET is successful, we move each file to the HISTORY directory and the retrieved file content is passed to the destination of the Data Flow.
PUT command example
The following example of the PUT command sends files to multiple directories on one Endpoint.
PUT *855* POAckSell/
PUT *997* FA/
When these commands run, files with names that contain 885 are put in the POAckSell directory and files with names that contain 997 are put in the FA directory.