DELETE

LANSA Integrator

DELETE

This keyword can be used to delete a file from a specified directory.

 

 DELETE -------- FILE -------- file path -------------------------|

 

Keywords

FILE

This keyword is used to define the file name to be deleted. The file path must be included.

It is recommended to use the forward slash as the path separator and to avoid the use of the DOS drive designator.

The format of the path should be as follows:

For Windows you can specify:

  • Absolute path.
    For example:
    /orders/order.json
    C:/orders/order.json

    C:\orders\order.json


    or
  • Relative path.
    For example, orders/order.json (note, no '/' at the start), in which case the document order.json will be deleted from the orders directory under the JSM Instance directory on your server.

For the IBM i you can specify:

  • Absolute path.
    For example:
    /orders/order.json

    or
  • Relative path.
    For example, orders/order.json (note, no '/' at the start), in which case the document order.json will be deleted from the orders directory under the JSM Instance directory on your server.

This keyword is mandatory.

 

Examples

RDML

 

* Define JSM fields

DEFINE FIELD(#JSMSTS) TYPE(*CHAR) LENGTH(020)

DEFINE FIELD(#JSMMSG) TYPE(*CHAR) LENGTH(256)

DEFINE FIELD(#JSMCMD) TYPE(*CHAR) LENGTH(256)

 

* Delete

CHANGE FIELD(#JSMCMD) TO('''DELETE FILE(orders/order.json)''')

USE BUILTIN(JSM_COMMAND) WITH_ARGS(#JSMCMD) TO_GET(#JSMSTS #JSMMSG)

 

RDMLX

 

* Define the fields used by the JSM Commands

Define Field(#JSMSTS) Type(*CHAR) Length(020)

Define Field(#JSMMSG) Type(*CHAR) Length(256)

Define Field(#JSMCMD) Type(*CHAR) Length(256)

Define Field(#JSMHND) Type(*CHAR) Length(4)

 

* Delete

Change Field(#JSMCMD) To('''DELETE FILE(orders/order.json)''')

Use Builtin(JSMX_COMMAND) With_Args(#JSMCMD) To_Get(#JSMSTS #JSMMSG #JSMHND)