Lesson 2 Naming Conflicts [ Using the 900 Series HP 3000: Fundamental Skills Module 6: Command Files ] MPE/iX 5.0 Documentation
Using the 900 Series HP 3000: Fundamental Skills Module 6: Command Files
Lesson 2 Naming Conflicts
One day you will probably create a command file and keep it with a name
you like, only to discover that the computer executes something entirely
different when you enter the name of the command file.
File names within a group must be unique.
But identical file names may exist in different groups. If your command
file has the same name as an MPE/iX command, the computer might execute
that other command and not the command file that you created.
NOTE The system does not allow duplication of file names in the same
group.
Discovering a name duplication
Create a command file that lists all of the file names in your account.
It should look like this when you create it in the editor:
________________________________________________________________________
| |
| |
| 1 listfile @.@ |
| |
________________________________________________________________________
Keep this file as SHOWVAR. Execute it. What happened? Did you get the
following on the screen?
________________________________________________________________________
| |
| |
| :SHOWVAR |
| NO MATCH FOUND FOR THIS VARIABLE SET. (CIWARN 8116) |
| |
________________________________________________________________________
This is not what you would expect. What happened?
SHOWVAR is an MPE/iX system command, and that is what the computer
executed, instead of your command file SHOWVAR.
Avoiding duplication
There are two ways to avoid file name duplication.
* Use the HELP command to check for duplicate file names before
naming a file.
* Use the MPE/iX system command XEQ.
HELP and verifying name duplications.
The MPE/iX system tries to interpret everything that you type at the
prompt as an instruction of some kind. This includes MPE/iX system
commands, programs, utilities, subsystems, and user-created executable
files, such as command files.
If you are a new user of the MPE/iX system, you certainly cannot know all
of the instructions that MPE/iX will accept. But you should always try
to keep your file names from duplicating the names of other commands on
the system.
Before you name a command file, check with the system first to see
whether the name that you want for your command file is already in use.
Use the help facility to do this.
At the MPE XL prompt, enter:
HELP showvarReturn
Since there is a SHOWVAR MPE/iX system command, you get the help facility
display.
________________________________________________________________________
| |
| |
| :SHOWVAR |
| |
| Displays specific variable names and their current values, |
| (NEW) |
| |
| SYNTAX |
| |
| :SHOWVAR [varid][,varid]...[,varid] |
| |
________________________________________________________________________
Enter:
HELP PSReturn
Something like the following appears on the screen if your proposed file
name matches the name of another executable file on the system.
________________________________________________________________________
| |
| |
| :HELP PS |
| USER DEFINED COMMAND FILE: PS.ETHEL.MERTZ |
| |
| PR |
| st |
| |
________________________________________________________________________
Try it.
Something like this appears on the screen if your proposed file name
matches a program file (or subsystem/utility) on the system.
________________________________________________________________________
| |
| |
| HELP sortReturn |
| PROGRAM FILE: SORT.PUB.SYS |
| |
________________________________________________________________________
The SORT command is an instruction already in the system. Saving your
command file as SORT would be pointless.
Try the name GLOBAL:
________________________________________________________________________
| |
| |
| HELP globalReturn |
| ^ |
| Can't find anything under this command or in table of contents. |
| |
________________________________________________________________________
You see this message if the name that you select is unique to the system.
You could, therefore, keep a command file called GLOBAL and successfully
execute it without getting surprising results, but...there is always an
exception.
NOTE Some kinds of executable files can be protected with various forms
of security. And one of those forms of security can hide the file
name from the help facility.
In such a case, you might be fooled into thinking that the file
name you want to use is unique and available for use.
The XEQ command.
The MPE/iX command XEQ bypasses system commands, programs, utilities, and
subsystems and executes command files--even in the case of name
duplication.
Try executing your SHOWVAR command file using the XEQ command:
XEQ showvarReturn
This time your command file called SHOWVAR should execute and display the
output from its one command, LISTFILE @.@.
Using XEQ along with your command file name does avoid potential naming
conflicts, but renaming your command file to avoid naming conflicts also
avoids any confusion over the purpose of two identically named,
executable files.
MPE/iX 5.0 Documentation