Current Directory and Path

The current directory is the current working directory, and is first in the search order when working with REXX File System (RFS). The current directory can be set using the CD command, see section CD. The CD command has a similar format to the IBM® Personal Computer OS/2 and IBM Personal Computer DOS CD commands. The syntax is CD followed by the partially or fully qualified directory name. To change from a subdirectory back to the parent directory, type CD ... To change to another subdirectory, CD can be followed by the subdirectory name.

In the following example, the first command sets the current directory to POOL1:\USERS\USER1 and the second command sets the current directory to POOL1:\USERS\USER1\DOCS. The third command changes the current directory back to POOL1:\USERS\USER1.

Example:
'CD POOL1:\USERS\USER1'
'CD DOCS'
'CD ..'

The PATH command is used to define the search order for REXX execs, after the current directory is searched. See the PATH command, section PATH, for more information. The syntax is: PATH, followed by a list, separated by spaces, of fully qualified directory names.

The following example first sets a current directory, then defines the search order.

Example:
'CD POOL1:\USERS\USER1\EXECS'
'PATH POOL1:\ POOL1:\USERS\USER1'
'EXEC TEST2.EXEC'

The exec name is fully qualified, using the directory ID of each directory in the search before the search of each respective directory is performed. The fully qualified names are as follows:

'POOL1:\USERS\USER1\EXECS\TEST2.EXEC'
'POOL1:\TEST2.EXEC'
'POOL1:\USERS\USER1\TEST2.EXEC'

When the REXX/CICS command EXEC is invoked, all three directories above are searched resulting in REXX/CICS finding the exec in the POOL1:\USERS\USER1 directory. If TEST2.EXEC existed in the POOL1:\ directory, RFS would have stopped searching when it was found. The first copy found in the search order is accessed.

Note:
Whenever a file name is not fully qualified, RFS follows the search order looking for the exec, beginning with the current directory. The first copy found is executed. If none are found, then an error is returned indicating the target file or exec was not found.