Guardian Programmer's Guide

Table Of Contents
Manipulating File Names
Guardian Programmer’s Guide 421922-014
13 - 20
Replacing a Subpart of a Process ID
SUBVOL^LEVEL,
SUFFIX);
IF ERROR <> 0 THEN ... !Error condition
Replacing a Subpart of a Process ID
To replace any subpart of a process ID, you need to use the subpart parameter of
the FILENAME_EDIT_ procedure. The subpart parameter specifies which element
of the process identifier you intend to change. For named processes, you can modify
the process name or its sequence number. For unnamed processes, you can modify
the CPU number, PIN, or sequence number.
You set the subpart parameter according to the subpart you intend to replace as
follows:
The following example changes the name of the named process \SYSA.$P1:321 to
\SYSA.$P2:321:
LITERAL MAXLEN = 256;
LITERAL PROCESS^LEVEL = 0;
LITERAL PROCESS^NAME^SUBPART = 4;
.
.
FNAME ':=' "\SYSA.$P1:321" -> @S^PTR;
FNAME^LENGTH := @S^PTR '-' @FNAME;
NEW^SUBPART ':=' "$P2" -> @S^PTR;
NEW^SUBPART^LENGTH := @S^PTR '-' @NEW^SUBPART;
ERROR := FILENAME_EDIT_(FNAME:MAXLEN,FNAME^LENGTH,
NEW^SUBPART:NEW^SUBPART^LENGTH,
PROCESS^LEVEL,
!options!,
PROCESS^NAME^SUBPART);
IF ERROR <> 0 THEN ... !Error condition
Comparing File Names
To compare two file names, use the FILENAME_COMPARE_ procedure. This
procedure returns either 0 if two names refer to the same object or -1 if the names
differ.
0 Replace the entire element (the default action).
1 Replace only the CPU part of an unnamed process file name.
2 Replace only the PIN.
3 Replace only the process sequence number.
4 Replace only the name part.