Path names (*PNAME)

A path name is a character string that can be used to locate objects in the integrated file system.

The string can consist of one or more elements, each separated by a slash (/). Each element is typically a directory or equivalent, except for the last element, which can be a directory, another object such as a file, or a generic presentation of an object or objects to be located.

Note: Some CL commands also allow the backslash (\) to be used as a separator by automatically converting the backslash (\) to a slash (/). Some other CL commands, however, treat the backslash (\) no differently than any other character. Therefore, the backslash (\) separator should be used with caution.

The / and \ characters and nulls cannot be used in the individual components of the path name when the / and \ characters are used as separators. The name can or cannot be changed to uppercase, depending on whether the file system containing the object is case-sensitive and whether the object is being created or searched for. If the parameter is defined as CASE(*MONO) (the default), any values that are not enclosed in single quotation marks will be changed to uppercase by the command analyzer.

A separator character (for example, /) at the beginning of a path name means that the path begins at the top most directory, the root (/) directory. If the path name does not begin with a separator character, the path is assumed to begin at the current directory of the user entering the command.

The path name must be represented in the CCSID currently in effect for the job. If the CCSID of the job is 65535, the path name must be represented in the default CCSID of the job. Hard-coded path names in programs are encoded in CCSID 37. Therefore, the path name should be converted to the job CCSID before being passed to the command. The maximum length of the path name character string on the CL commands is 5000 characters.

When operating on objects in the QSYS.LIB file system, the component names must be of the form name.object-type; for example:


'/QSYS.LIB/PAY.LIB/TAX.FILE'

If the objects are in an independent ASP QSYS.LIB file system, the name must be of the form:


'/asp-name/QSYS.LIB/PAY.LIB/TAX.FILE'

where asp-name is the name of the independent ASP.

Path names must be enclosed in single quotation marks (') when entered on a command line if they contain special characters. These marks are optional when path names are entered on displays. If the path name includes any quoted strings or special characters; however, the enclosing '' marks must be included. The following are rules for using special characters:

  • A tilde (~) character followed by a separator character (for example, /) at the beginning of a path name means that the path begins at the home directory of the user entering the command.
  • A tilde (~) character followed by a user name and then a separator character (for example, /) at the beginning of a path name means that the path begins at the home directory of the user identified by the user name.
  • In some commands, an asterisk (*) or a question mark (?) can be used in the last component of a path name to search for patterns of names. The * tells the system to search for names that have any number of characters in the position of the * character. The ? tells the system to search for names that have a single character in the position of the ? character.
  • To avoid confusion with IBM® i special values, path names cannot start with a single asterisk (*) character. To perform a pattern match at the beginning of a path name, use two asterisks (**).
    Note: This only applies to relative path names where there are no other characters before the asterisk.
  • The path name must be enclosed in single quotation marks (') and quotation marks (") if any of the following characters are used in a component name:
    • Asterisk (*)
      Note: To avoid confusion with IBM i special values, do not start path names with a single asterisk (*) character.
    • Question mark (?)
    • Single quotation mark (')
    • Quotation mark (")
    • Tilde (~), if used as the first character in the first component name of the path name (if used in any other position, the tilde is interpreted as just another character)
    Note: Using the previous characters as the first character in the first component name of the path name is not recommended because the meaning of the character in a command string could be confused and it is more likely that the command string will be entered incorrectly.
  • Do not use a colon (:) in path names. It has a special meaning within the system.
  • The processing support for commands and associated user displays does not recognize code points below hexadecimal 40 as characters that can be used in command strings or on displays. If these code points are used, they must be entered as a hexadecimal representation, such as the following example:
    
    crtdir dir(X'02')
    

    Therefore, use of code points below hexadecimal 40 in path names is not recommended. This restriction applies only to commands and associated displays, not to APIs. In addition, a value of hexadecimal 00 is not allowed in path names.