The SET command is used for two distinct operations. Use the DIR keyword to set the current working directory or alternatively use the LIST or FRAGMENT keywords to populate the outbound document object.
Fragments use only fields, so the SET FRAGMENT command requires the SERVICE_EXCHANGE(*FIELD) keyword.
Lists use only a working list, so the SET LIST command requires a working list argument.
Once you have completed your SET commands your next command would invariably be the WRITE command.
Command | Keyword | Value | Developer notes |
|---|---|---|---|
SET | LIST | value | Conditional. Bind list name. |
FRAGMENT | value | Conditional. Bind fragment name. | |
SUBSET | Optional. See SUBSET. | ||
DIR | value | Conditional. Nominate a relative or absolute path to be set as the current directory. |
SET LIST(ORDERS) #WRKLST
SET FRAGMENT(DETAIL) SERVICE_EXCHANGE(*FIELD)
There are two possible ways to add a list of data when creating a JSON document.
Whichever way you choose, you will need to carefully decide whether the relevant section of JSON is defined as a List or a Fragment.