PATH
8.0
The PATH instruction provides a means of retrieving or modifying the current directory path and creating or deleting another directory path. The instruction uses the following format:
|
|
|
|
|
|
|
|
|
|
Where:
label
Optional. A Program Execution Label.
mode
Required. One of the following valid PATH modes from the table below.
sep
Required. A comma or one of the following prepositions: BY, TO, OF, FROM, USING, WITH, IN, or INTO.
path
Required. A previously defined Character String Variable or a string Literal that specifies or receives the path information based upon the mode.
tcpip id:port
Optional. String literal data that contains the IP address and port number of the server executing the Data Manager where the instruction is executed.
Flags Affected: EOS, OVER
Note the following:
The supported modes are:
|
Mode |
Function |
|
CURRENT |
Retrieve the current directory path. |
|
CHANGE |
Change to a different existing directory path. |
|
CREATE |
Create a new, non-existent directory path. |
|
DELETE |
Delete an existing directory path. |
|
EXIST |
Check for existence of specified directory path. |
If CURRENT is specified and the {path} variable is a null string, the current directory path is transferred to {path} using a MOVE character string to character string technique. If {path} is too small to hold all the directory path information, only those bytes that fit are transferred and the EOS Condition Flag is set.
You may use CURRENT to retrieve the path for your current drive or any other valid drive on your system. If the {path} variable contains a valid drive designator (C:, D:, etc.), the path information for that drive is retrieved. If any other information is in the {path} variable, no path information is moved and the OVER flag is set.
If CHANGE, CREATE, DELETE, or EXIST is specified, the Logical String of {path} is assumed to contain the directory path used for the operation. {path} remains unchanged.
If a CURRENT, CHANGE, CREATE, DELETE, or EXIST operation fails, the OVER Condition Flag is set. The following are examples of why the operation could fail:
Specified {path} contains invalid syntax.
Specified {path} for CHANGE, DELETE, or EXIST does not exist.
Specified {path} for CREATE already exists as a file or directory.
Specified directory for DELETE is not empty.
CURRENT or CHANGE perform no action when using the PLBCE runtime.
The PATH instruction allows operations at the Sunbelt Data Manager when the DM_ALLOWPATH keyword is enabled in the Data Manager configuration file. If the keyword is not enabled, attempts to use the PATH instruction at the Data Manager will result in an I82 subcode 33 error.
When the {tcpip id:port} address is provided as part of the {path} variable or literal, the instruction is executed at the server where the Data Manager is executing. In this case, the instruction logs on to the Data Manager, performs the operation, and logs off from the Data Manager for a CREATE, DELETE, EXISTS, or CURRENT action.
If the {tcpip id:port} address is used with the PATH CHANGE keyword, the PATH instruction can takes affect at the Data Manager as follows:
A. When the PLB_CURDIR keyword has been specified in the SUNDM CFG file the logical current working directory for the child thread is changed at the Data Manager.
B. If the PLB_CURDIR keyword is not used by the Data Manager, the PATH CHANGE instruction changes the directory for the Data Manager process which affects all clients accessing the Data Manager.
Warning: When the PATH CHANGE instruction is executed, the client program logs on to the Data Manager and remains connected indefinitely. The connection remains active until the program is terminated or until a SETMODE *DMKEEPACTIVE=0 instruction is executed. Please note that a CHAIN instruction does not cause this connection to be disconnected. See the GETMODE and SETMODE *DMKEEPACTIVE description for more information.
The PATH instruction supports Windows Drive Substitution when using the CREATE, CHANGE, DELETE, and EXIST keywords. (9.6)
See Also: Example Code, SEARCHPATH, System Interface Instructions
![]() |