5.22.6 READ

The READ command places the specified message content into a working list. The working list definition must be appropriate for the expected content. For example, if you nominate to read text content a single field is required in your working list. If you are reading anything other than text (i.e. content which includes a separator value) the working list must be defined so it can handle the maximum number of columns in the content.

The ENCODING keyword and CONTENT keyword control the content handling requirements.

Syntax:

Command

Keyword

Value

Developer notes

READ

OBJECT

*TEXT

Indicates the body text of the message is to be read into a working list. If the message content-type does not start with text/ or multipart/ the command will return NOTEXT in the status field.

*ATTACHMENT

Use this value to nominate a specific attachment to be read into a working list. Use this value in combination with the ENTRY or SELECT keywords to identify the attachment to be saved. If neither ENTRY nor SELECT is specified, the first attachment is read. If there are no attachments associated with the current message the command status is returned as NOATTACHMENT.

ENTRY

integer

Specify the file number of the attachment to be read.
The number assigned to each attachment is determined by the order the attachments were added to the email by the sender.
Default. 1.

SELECT

value

Select an attachment file to be read based on the attached file name.

ENCODING

encoding

Specify what encoding must be applied to the content to convert it to a Unicode string. The default value for the ENCODING keyword is *DEFAULT.

Refer to ENCODING for more information.

CONTENT

*TEXT

Read the attachment file content as text into the working list.

*SV

Read the attachment file content as separated value into the working list.

*CSV

Read the attachment file content as CSV into the working list.

*TSV

Read the attachment file content as TSV into the working list.

SEPARATOR

 

Optional. See SEPARATOR.

SVROW

 

Optional. See SVROW.

SVROWLIMIT

 

Optional. See SVROWLIMIT.

SVMODE

 

Optional. See  SVMODE.

SVHEAD

 

Optional. See SVHEAD.

NUMBERFORMAT

 

 

Optional. See NUMBERFORMAT.

 

Example

READ OBJECT(*TEXT) #WRKLST(TXT)

 

READ OBJECT(*ATTACHMENT) ENTRY(2) CONTENT(*TEXT) #WRKLST(TXT)