Where allowed to run: Compiled CL program or interpreted REXX (*BPGM *IPGM *BREXX *IREXX) Threadsafe: No |
Parameters Examples Error messages |
The Retrieve Current Directory (RTVCURDIR) command is used in a control language (CL) program to retrieve the name of the current directory into the specified CL variable. An absolute path name containing no symbolic links is retrieved. The length of the name of the current directory is also retrieved.
The CL prompt for this command lists the minimum length for retrieved variables next to the appropriate parameters. For character variables, a single number is shown. For decimal variables, two numbers are shown. The first number indicates the minimum variable length and the second number indicates the minimum number of decimal positions.
Restrictions:
Note: The maximum length of a character variable cannot exceed 9999 bytes.
Top |
Keyword | Description | Choices | Notes |
---|---|---|---|
RTNDIR | CL var for RTNDIR (9999) | Character value | Required, Positional 1 |
DIRNAMLEN | CL var for DIRNAMLEN (7 0) | Decimal number | Required, Positional 2 |
Top |
Specifies the name of the CL variable that receives the name of the current directory. The variable must be a character variable. If the current directory name has fewer characters than the variable allows, the value is not padded.
Top |
Specifies the name of the CL variable that receives the length (in bytes) of the current directory name. This length can be longer than the length of the character variable to receive the directory name. The variable must be a 7-digit decimal variable specified with no decimal positions.
Top |
Example 1: Retrieving the Current Directory
RTVCURDIR RTNDIR(&CD) DIRNAMLEN(&CDLEN)
This command retrieves the name of the current directory and the length of the name of the current directory into the CD and CDLEN variables.
Top |
*ESCAPE Messages
Top |