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.




 READ ---------- OBJECT --------- none --------------------------->






             >-- CONTENT -------- *TEXT -------------------------->





             >-- SEPARATOR ------ value -------------------------->






             >-- ENTRY ---------- 1 ------------------------------>



             >-- SELECT --------- value -------------------------->


             >-- ENCODING ------ *DEFAULT ------------------------>



             >-- SVROW ---------- value -------------------------->


             >-- SVROWLIMIT ----- value -------------------------->





             >-- SVMODE --------- *NONE -------------------------->




             >-- SVHEAD --------- value -------------------------->


             >-- NUMBERFORMAT --- *NONE --------------------------|








This keyword specifies what part of the current message is to be read.

A value of *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.

Use a value of *ATTACHMENT to nominated 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 saved. If there are no attachments associated with the current message the command status is returned as NOATTACHMENT.

Refer to RDML / RDMLX Reserved Keywords for details on how to define the working list on the command. 


By default the email content is processed as text.

If the attachment is plain text, use CONTENT(*TEXT) to read the text into the working list.

Alternately the content can be processed as a Comma separated variables (*CSV), Tab separated variables (*TSV) or separated by a variable (*SV) as specified in the separator keyword. If processing content that includes a separator variable refer to the SEPARATOR, SVHEAD,  SVMODE, NUMBERFORMAT, TRIM and TRUNCATE keywords for additional processing options.

The working list used to store the body text or attachment content must be defined with an appropriate number of columns to store the data. Refer to RDML / RDMLX Reserved Keywords for details on how to define the working list on the command.


This keyword is used by separated value services to identify the content separator.

If the SEPARATOR keyword is present and no CONTENT keyword is provided then CONTENT(*SV) is assumed.

Refer to SEPARATOR for more information.


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


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


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

Refer to ENCODING for more information.


The optional keyword SVROW is used to specify the starting row when reading records.

Refer to SVROW for more information.


The optional keyword SVROWLIMIT is used to specify the number of rows to be read.

Refer to SVROWLIMIT for more information.


This keyword is used by content handlers and services that process separated value data to define how to handle the inbound separated value data.

Refer to  SVMODE for more information.


The optional keyword is used to describe the field layout of the separated value data.

Refer to SVHEAD for more information.


This optional keyword handles numeric strings where the decimal separator is not the decimal point character ".".

Refer to NUMBERFORMAT for more information.



Using the TRUNCATE keyword ensure body content is added to the working list even if the line length exceeds the length of the field in the working list.









Attachment files can be processed according to their content and the users knowledge of the content. For example when an email has an attachment file message01.txt with content like:


     first, second, third, fourth

     1, 2, 3, 4

     uno, dos, tres , quatro

     un , deux , trios ,


Read the content of this attachment as text (with each line of content place into a single field in a working list)


def_list name(#attachlst) fields(#fielda) type(*working)


use builtin(jsmx_command) with_args(#jsmhandle 'read object(*attachment) content(*text) select(message01.txt)') to_get(#jsmsts #jsmmsg #attachlst)




Read the attachment as a comma separated variables file (where the working list would be required to have four columns).


def_list name(#attachlst) fields(#fielda #fieldb #fieldc #fieldd) type(*working)


use builtin(jsmx_command) with_args(#jsmhandle 'read object(*attachment) content(*csv) select(message01.txt)') to_get(#jsmsts #jsmmsg #attachlst)