OPEN

The OPEN command opens an existing zip file and makes it the current archive. The current archive is the archive upon which subsequent ADD and GET commands operate.

 

                                                         Required

 

 OPEN ---- FILE ------------ file path ------------------------->

 

                                                         Optional

 

       >-- MODE ------------ *READ ----------------------------->

                             *WRITE

 

       >-- REPLACE --------- *NO -------------------------------|

                             *YES

 

Keywords

FILE

This keyword is used to specify the file name and path of the Zip file.

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.zip
    C:/orders/order.zip

    C:\orders\order.zip


    or
  • Relative path.
    For example, orders/order.zip (note, no '/' at the start), in which case the order.zip file must reside in the orders directory under the JSM Instance directory on your server.

For the IBM i you can specify:

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

    or
  • Relative path.
    For example, orders/order.zip (note, no '/' at the start), in which case the order.zip file must reside in the orders directory under the JSM Instance directory on your server.

Note: Whatever directory structure you specify must already exist.

This keyword is mandatory.

MODE

The MODE indicates whether the file is to be opened for reading or writing. Open the file for reading when you open an existing archive to interrogate its contents or to expand files contained in it. Open a file for writing when opening a file to add to or replace its contents.

The default value of *READ indicates the file is opened for reading only.

A value of *WRITE opens the file for writing. This allows new files to be added to the archive. If the file is opened for writing and it does not exist a new archive is created.

REPLACE

The REPLACE keyword is used in combination with MODE(*WRITE) to indicate whether the contents of the existing file can be replaced.

The default value *NO indicates that the contents of the archive are not cleared when the file is opened. New files can be added to the archive.

A value of *YES indicates that the existing contents of the archive are cleared when the file is opened. New files can be added to the empty archive.

Examples

RDML

 

USE BUILTIN(JSM_COMMAND) WITH_ARGS('OPEN FILE(MYARCHIVE.ZIP)') TO_GET(#JSMSTS #JSMMSG)

 

RDMLX

 

use builtin(jsmx_command) with_args(#jsmxhdle1 'open file(myarchive.zip)') to_get(#jsmxsts #jsmxmsg)