5.6.11 GET

The GET command will receive the contents of a remote file and save it to a local file.

Syntax:

Command

Keyword

Value

Developer notes

GET

FROM

value

Required. Remote file path.
This value can be a relative or absolute path. If the path is relative, the current working directory is the remote FTP server's current directory.

TO

value

Required. Local file path.
This value can be a relative or absolute path. If the path is relative, the current working directory is the JSM instance directory.

NOT_EXIST

*STATUS

If this keyword is specified on the command, a NOT_EXIST status is returned if the remote file does not exist.

FROM_ENCODING

encoding

Encoding is used to convert the FROM file content to an intermediate Unicode string.
A default value is obtained from the from.encoding property resource. If no property resource is located the value defaults to Cp037. Only use this keyword when CONVERT is set as *YES.

TO_ENCODING

encoding

Encoding is used to convert the intermediate Unicode string to target encoding.
A default value is obtained from the to.encoding property resource. If no property resource is located the value defaults to ISO8859_1.
Only use this keyword when CONVERT is set as *YES.

CONVERT

*NO

Default. No conversion.

*YES

Indicates that after each record size read, the data will be converted to the specified target encoding and written to the local file.

RECORD_SIZE

integer

An integer value specifies the read size, in bytes, to be used on the source file.

The default value is 1024 bytes.

Refer to  Comments / Warnings at the end of the PUT command.

RECORD_DELIMITER

*LF

Add LF to the end of each converted record.

 

 

*CRLF

Add CRLF to the end of each converted record.

*NONE

Default. No record delimiter.

DATALINK

*PASV

Default. Use passive mode.

*PORT

Use port mode.

 

Example

GET FROM(/folder/file.csv) TO(/folder/file.csv)