Establishing the Default Usercode for Disk Files

One of the effects of the USERCODE task attribute is to supply a default usercode for all disk files used by a process. For example, suppose a process runs with a USERCODE value of FERMAT. Suppose also that this process attempts to open a file with a TITLE file attribute of INPUT/DATA ON DBFAM. In this case,

  • If the NEWFILE file attribute is TRUE, the system creates the file under usercode FERMAT and changes the TITLE file attribute to (FERMAT)INPUT/DATA ON DBFAM.

  • If the NEWFILE file attribute is FALSE, the system searches for the file first under the title (FERMAT)INPUT/DATA ON DBFAM. If no file of that title exists, the system searches for the file under the title *INPUT/DATA ON DBFAM.

A process can override the default behavior by assigning a usercode as part of the TITLE file attribute before attempting to open the file. For example, a process could assign TITLE the value (LUANN)INPUT/DATA ON DBFAM. In this case, the system searches for the file only under usercode LUANN.

Note: The preceding description of default usercodes applies only to files for which the SEARCHRULE file attribute value is NATIVE. For an explanation of the file searching rules used when SEARCHRULE = POSIX, refer to Specifying a Current Directory later in this section.