IFS_PATH scalar function
The IFS_PATH scalar function returns a specified part of the input path string.
It is assumed that the path string represents an object in the integrated file system (IFS). It can be an absolute path, a relative path, or only an IFS object.
In order to use the IFS_PATH function, the International Components for Unicode (ICU) option (5770SS1 Option 39) must be installed.
Authorization: See Note below.
- path-name
- A character string containing a path.
- subsection
- A character string that indicates which part of path-name is to be returned. No special handling is done when '.' or '..' is included as a directory name within the path string.
Note
This function is provided in the SYSTOOLS schema as an example of using regular expressions in an SQL scalar function. Similar to other Db2® for i provided tools within SYSTOOLS, the SQL source can be extracted and used as a model for building similar helper functions, or to create a customized version within a user-specified schema.
Services provided in SYSTOOLS have authorization requirements that are determined by the interfaces used to implement the service. To understand the authority requirements, extract the SQL for the service and examine the implementation.
Example
VALUES SYSTOOLS.IFS_PATH( PATH_NAME => '/usr/mydir/prior_resultfile.txt',
SUBSECTION => 'PATH PREFIX')
CONCAT 'status_' CONCAT VARCHAR_FORMAT(current date, 'YYMMDD') CONCAT '.txt';
