RFS commands

Under the RFS command environment you issue commands to interface with RFS. If you set the command environment to RFS, you should not specify RFS in front of RFS commands.

Example:

'RFS DISKR POOL1:\USERS\USER1\TEST.EXEC DATA.'

This example reads the contents of the RFS file TEST.EXEC into the REXX compound variable DATA. TEST.EXEC is in the fully qualified directory: POOL1:\USERS\USER1\.

The syntax for the RFS commands follow.

AUTH

Read syntax diagramSkip visual syntax diagram                     .-PRIVATE-.
>>-RFS--AUTH--dirid--+---------+-------------------------------><
                     +-PUBLICR-+
                     +-PUBLICW-+
                     '-SECURED-'
 

AUTH authorizes access to RFS directories.

Operands

dirid
specifies a REXX File System directory identifier. This is partially or fully qualified. See the CD command, CD, for more information.
PRIVATE
specifies that only the owner of the directory has read/write access to the files. This is the default.
PUBLICR
specifies that any user has read-only access to the files in the directory.
PUBLICW
specifies that any user has read/write access to the files in the directory.
SECURED
specifies that an external security manager grants access to the files in the directory.

Return Codes

See the RFS command, section RFS.

Example

'RFS AUTH POOL1:\USERS\USER1\DOCS PUBLICR'

This example makes directory DOCS a public directory. All users have read/only access to the files in directory DOCS.

CKDIR

Read syntax diagramSkip visual syntax diagram>>-RFS--CKDIR--dirid-------------------------------------------><
 

CKDIR checks for an existing RFS directory level.

Operands

dirid
specifies a REXX File System directory identifier. This is partially or fully qualified. See the CD command, section CD, for more information.

Return Codes

See the RFS command, section RFS.

Example

'RFS CKDIR POOL1:\USERS\USER1\DOCS'

This example checks for a directory called DOCS in the existing directory POOL1:\USERS\USER1.

CKFILE

Read syntax diagramSkip visual syntax diagram>>-RFS--CKFILE--fileid-----------------------------------------><
 

CKFILE checks to see if the specified, partially or fully qualified, file ID exists.

Operands

fileid
specifies the file identifier.

Return Codes

See the RFS command, section RFS.

Example

'CKFILE POOL1:\USERS\USER1\TEST.EXEC'

This example checks for a file called TEST.EXEC in the existing directory POOL1:\USERS\USER1.

COPY

Read syntax diagramSkip visual syntax diagram>>-RFS--COPY--fileid1--fileid2---------------------------------><
 

COPY copies a file.

Operands

fileid1
specifies the source file identifier, it may be a fully or partially qualified directory and file identifier.
fileid2
specifies the target file identifier, it may be a fully or partially qualified directory and file identifier.
Note:
If the target file (fileid2) already exists, the contents of fileid1 replaces it.

Return Codes

See the RFS command, section RFS.

Example

'RFS COPY POOL1:\USERS\USER1\TEST1.EXEC POOL1:\USERS\USER1\TEST2.EXEC'

This example copies TEST1.EXEC to TEST2.EXEC within the directory POOL1:\USERS\USER1.

DELETE

Read syntax diagramSkip visual syntax diagram>>-RFS--DELETE--fileid-----------------------------------------><
 

DELETE deletes an RFS file.

Operands

fileid
specifies the name of the file to be deleted. This may be partially or fully qualified.

Return Codes

See the RFS command, section RFS.

Example

'RFS DELETE POOL1:\USERS\USER1\TEST1.EXEC'

This example deletes file TEST1.EXEC within directory POOL1:\USERS\USER1.

DISKR

Read syntax diagramSkip visual syntax diagram                       .-DATA.-.
>>-RFS--DISKR--fileid--+-------+-------------------------------><
                       '-stem.-'
 

DISKR reads records from an RFS file.

Operands

fileid
specifies the file identifier.
stem.
specifies the name of a stem. (A stem must end in a period.) See section Stems for more information. The default stem is DATA..

Return Codes

See the RFS command, section RFS.

Example

'RFS DISKR POOL1:\USERS\USER1\TEST.DATA DATA.'

This example stores the entire contents of the RFS file POOL1:\USERS\USER1\TEST.DATA in the DATA. REXX compound variable.

Note

DATA.0 is set to the number of records read from the file. DATA.n contains the nth record read from the file.

DISKW

Read syntax diagramSkip visual syntax diagram                       .-DATA.-.
>>-RFS--DISKW--fileid--+-------+-------------------------------><
                       '-stem.-'
 

DISKW writes records to an RFS file from a stem. The file is overlaid with the data in the stem.

Operands

fileid
specifies the file identifier.
stem.
specifies the name of a stem. (A stem must end in a period.) See section Stems for more information. The default stem is DATA..

Return Codes

See the RFS command, section RFS.

Example

'RFS DISKW POOL1:\USERS\USER1\TEST.EXEC DATA.'

This example stores the contents of the DATA. REXX compound variable into the RFS file POOL1:\USERS\USER1\TEST.EXEC.

Note

Set DATA.0 to the number of records to be written to the file.

GETDIR

Read syntax diagramSkip visual syntax diagram>>-RFS--GETDIR--stem.--+-------+-------------------------------><
                       '-dirid-'
 

GETDIR returns a list of the contents of the current or specified directory into the specified REXX array.

Operands

stem.
specifies the name of a stem. (A stem must end in a period.) See section Stems for more information.
dirid
specifies a REXX File System directory level identifier. This is partially or fully qualified. See the CD command, section CD, for more information.

Return Codes

See the RFS command, section RFS.

Example

'RFS GETDIR DIRDOC. POOL1:\USERS\USER1\DOCS'

This example places the contents of directory DOCS in the DIRDOC. REXX compound variable.

MKDIR

Read syntax diagramSkip visual syntax diagram>>-RFS--MKDIR--dirid-------------------------------------------><
 

MKDIR creates a new RFS directory level.

Operands

dirid
specifies a REXX File System directory identifier. This is partially or fully qualified. See the CD command, section CD, for more information.

Return Codes

See the RFS command, section RFS.

Example

'RFS MKDIR POOL1:\USERS\USER1\DOCS'

This example creates a new directory called DOCS in the existing directory POOL1:\USERS\USER1.

Note

Only authorized users can create directories outside of their \USERS\userid directory structure.

RDIR

Read syntax diagramSkip visual syntax diagram>>-RFS--RDIR--dirid--------------------------------------------><
 

RDIR removes the specified RFS directory.

Operands

dirid
specifies a REXX File System directory identifier. This is partially or fully qualified. Refer to the CD command, section CD, for more information.

Return Codes

Refer to the RFS command, section RFS.

Example

'RFS RDIR POOL1:\USERS\USER1\DOCS'

This example deletes a directory called DOCS in the existing directory POOL1:\USERS\USER1.

RENAME

Read syntax diagramSkip visual syntax diagram>>-RFS--RENAME--fileid1--fileid2-------------------------------><
 

RENAME renames an RFS file to a new name.

Operands

fileid1
specifies the source file identifier, it may be a fully or partially qualified directory and file identifier.
fileid2
specifies the source target file identifier, it may be a fully or partially qualified directory and file identifier.
Note:
If the target file (fileid2) already exists, the contents of fileid1 replaces it.

Return Codes

See the RFS command, section RFS.

Example

'RFS RENAME POOL1:\USERS\USER1\TEST1.EXEC POOL1:\USERS\USER1\TEST2.EXEC'

This example renames the file POOL1:\USERS\USER1\TEST1.EXEC to POOL1:\USERS\USER1\TEST2.EXEC.