HPlogo Task Reference: HP 3000 Series 9X8LX Computer Systems > Chapter 2 Performing Tasks Using MPE/iX Commands

Viewing File Information

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

NOTE: The MPE/iX operating system has been enhanced as of Release 4.5 to include additional features that include POSIX compatibility and the hierarchical file system. The hierarchical file system is tree structured and can contain files at many different levels. This organization provides a special kind of file called a directory. Instead of holding data, directories contain lists of files and pointers to those files. For more information on POSIX and the hierarchical file system, refer to the book, New Features of MPE/iX: Using the Hierarchical File System (32650-90351), included in this documentation set. This book includes an overview of the following enhancements of MPE/iX as of Release 4.5 and 5.0:
  • Open systems environment

  • Hierarchical file system (HFS)

  • Expanded file naming syntax

  • New and enhanced commands and utilities

  • MPE/iX Shell and Utilities

  • MPE/iX Developer's Kit

Files store the information with which you work. Reports, financial data, program listings, letters, management tools, and more exist within the system in the form of files. Files in the PUB group of an account are usually the files that users of the account share. Files in other groups in the account are often the private files of that group's users. Files must have unique names within the group, but two files in different groups might have the same name. You can display a list of files in your group and account.

To list file names to your screen

There are many ways to display a list of files. The following sections offer ways of displaying sets of files with a single command, LISTFILE.

To list all file names in your current group and account

To list the names of all files in your current group and account, use the LISTFILE command.

  1. At the system prompt, type LISTFILE.

  2. Press Return.

   :LISTFILE Return

Your screen displays whatever file names you have in your logon group.

Here is a sample display:

   :LISTFILE

   FILE NAME



   ADDCAP   ALLMTNS   ALPHA    AMSPELL   BITSOM  MINUTES

   CLEAN    PATH

   :_

To list all file names that begin the same

To list the names of all files in your group and account that begin with the same letter or letters, use the wildcard character (@) after the common portion of the file name.

  1. At the system prompt, type LISTFILE xxx@. (Replace xxx with the beginning letter or letters of the files that you wish to be displayed.)

  2. Press Return.

The following example displays all files in your current group and account that begin with the letters "ABC":

   :LISTFILE ABC@ Return

To list all file names that end the same

To display the names of all files in your group and account that end with the same letter or series of letters, use the wildcard character @ immediately preceding the common part of the file name and for the group:

  1. At the system prompt, type LISTFILE @xxx. Replace xxx with the ending letter or letters of the files that you wish to display.

  2. Press Return.

The following example lists files in your current group and account that end in the letters "TXT".

   :LISTFILE @TXT Return

To list all file names in a specific group and account

To list the names of all files in a specific group of an account, use the LISTFILE command and provide a group name and an account name. Use the wildcard character (@) for the file name.

  1. At the system prompt, type LISTFILE @.groupname.accountname.

  2. Press Return.

The following example lists all files (indicated by the @) in the QTR1 group of the PAYROLL account:

   :LISTFILE @.QTR1.PAYROLL Return

To list all file names in all groups in an account

To list the names of all files in all groups of an account, use the LISTFILE command. Use the wildcard character (@) for the file name and group name, and provide an account name.

  1. At the system prompt, type LISTFILE @.@.accountname.

  2. Press Return.

The following example lists all files in all groups of the PAYABLE account.

   :LISTFILE @.@.PAYABLE Return

To list all file names on the system

To list the names of all files in all groups in all accounts, use the LISTFILE command with wildcard characters for the file name, the group, and the account.

  1. Type LISTFILE @.@.@ at the system prompt.

  2. Press Return. For example:

   :LISTFILE @.@.@ Return

For a system with several users, this command may generate a large display. The system scrolls lines of text until it reaches the end of the data. Enter CTRL S to stop the scrolling. Enter CTRL Q to continue the scrolling.

NOTE: The LISTFILE command has been enhanced as of Release 4.5 to include additional features. For more information on these features, refer to the book, Commands Reference - HP 3000 Series 9X8LX (B3813-90011), included in this documentation set.

To get specific information about files

To get specific information about a file, use one of the options of the LISTFILE command. The options can be entered as keywords or option numbers.

To find the maximum number of records

To find the maximum number of records in a file, use the SUMMARY or 1 option of the LISTFILE command.

  1. At the system prompt, type LISTFILE filename,SUMMARY (or 1).

  2. Press Return.

The following example provides a summary screen for the file TEMPREC:

   :LISTFILE TEMPREC,SUMMARY Return

or

   :LISTFILE TEMPREC,1 Return

This option displays a screen similar to the following:

   ACCOUNT=  PAYROLL         GROUP=    QTR3



   FILENAME   CODE     -------- LOGICAL RECORD ------

                       SIZE  TYP      EOF     LIMIT 



    TEMPREC             80B   FA       10        10 

This screen displays the following information:

  • file group and account information (ACCOUNT=, GROUP=)

  • file name (FILENAME)

  • file code (CODE)

  • record size (SIZE)

  • type of file format and data representation, such as fixed or variable, ASCII or binary (TYP)

  • current end-of-file location (EOF)

  • maximum number of records allowed in the file (LIMIT)

To display file specifications

To display the file specifications and security levels of a file, use the DETAIL or 3 option of the LISTFILE command.

  1. At the system prompt, type LISTFILE filename,DETAIL (or 3).

  2. Press Return.

The following example displays file specifications and security levels of the TEMPREC file:

   :LISTFILE TEMPREC,DETAIL Return

or

   :LISTFILE TEMPREC,3 Return

This option displays the following information:

   *******************************

   FILE:  TEMPREC.QTR3.PAYROLL



   FILE CODE : 0          FOPTIONS: ASCII, FIXED, NOCCTL, STD

   BLK FACTOR: 10         CREATOR : **

   REC SIZE: 80(BYTES)    LOCKWORD: **

   BLK SIZE: 80(BYTES)    SECURITY--READ    : ANY

   EXT SIZE: 8(SECT)                WRITE   : ANY

   NUM REC: 10                      APPEND  : ANY

   NUM SEC: 16                      LOCK    : ANY

   NUM EXT: 1                       EXECUTE : ANY

   MAX REC: 10                   ** SECURITY IS ON

   NUM LABELS: 0         FLAGS   :  NO ACCESSORS

   MAX LABELS: 0         CREATED :  MON, SEP 10, 1990,  7:21 PM

   DISC DEV# :15         MODIFIED:  THU, NOV 15, 1990,  9:54 PM

   CLASS     :DISC       ACCESSED:  THU, NOV 15, 1990,  9:54 PM

   SEC OFFSET:0          LABEL ADDR:  **


This screen displays the following information:

  • complete file name

  • record and extent sizes

  • number of records

  • file security access rights for the user

  • dates when the file was created, modified, and last accessed

To display security levels

To display the security levels of a file, its group, and its account, use the SECURITY or 4 option of the LISTFILE command.

  1. At the system prompt, type LISTFILE filename, SECURITY (or 4).

  2. Press Return.

The following example displays the security level for the TEMPREC file:

   :LISTFILE TEMPREC, SECURITY Return

or

   :LISTFILE TEMPREC,4 Return

This option displays a screen similar to the following:

   *******************************

   FILE:  TEMPREC.QTR3.PAYROLL



      ACCOUNT -------------- READ : ANY

                            WRITE : AC

                           APPEND : AC

                             LOCK : ANY

                          EXECUTE : ANY



      GROUP ---------------- READ : ANY

                            WRITE : AL, GU

                           APPEND : AL, GU

                             LOCK : AL, GU

                          EXECUTE : ANY

                             SAVE : GU



      FILE ----------------- READ : ANY          FCODE : 0

                            WRITE : ANY        **SECURITY IS ON

                           APPEND : ANY          NO ACDS

                             LOCK : ANY

                          EXECUTE : ANY



   FOR USER1.PAYROLL: READ, WRITE, LOCK, APPEND, EXECUTE

This screen displays the following information:

  • account-level, group-level, and file-level security (READ, WRITE, APPEND, LOCK, EXECUTE)

  • a listing of user's file access rights (FOR username.acctname: READ, WRITE, LOCK, and so on.)

  • status of file's security (either SECURITY IS ON or SECURITY IS OFF)

To display a fully qualified file name

To display the fully qualified file name of a file, use the QUALIFY or 6 option of the LISTFILE command. The fully qualified file name is composed of the file name, its group name, and its account name.

  1. At the system prompt, type LISTFILE filename,QUALIFY (or 6).

  2. Press Return

The following example displays the fully qualified name of the TEMPREC file:

   :LISTFILE TEMPREC,QUALIFY Return

or

   :LISTFILE TEMPREC,6 Return

This option displays the following information:

   TEMPREC.QTR3.PAYROLL

The wildcard character @ may be used in place of file, group, and account names. For example:

  • To list all qualified file names in the group QTR3 of the PAYROLL account:

       LISTFILE @.QTR.PAYROLL, QUALIFY Return
    
  • To list all qualified file names in all groups of the PAYROLL account:

       LISTFILE @.@.PAYROLL, QUALIFY Return
    
  • To list all qualified file names on the system:

       LISTFILE @.@.@, QUALIFY Return
    

To display the lockword and creator

To display the lockword and creator of a file, use option -3 of the LISTFILE command. This option is available to only the system manager (SM capability), or the account manager (AM capability) of the account that the file is in.

  1. At the system prompt, type LISTFILE filename, -3.

  2. Press Return.

The following example displays the creator of the TEMPREC file and any lockword assignments:

   :LISTFILE TEMPREC, -3 Return

This option displays the following information:

   *******************************

   FILE:  TEMPREC.QTR3.PAYROLL



   FILE CODE : 0          FOPTIONS: ASCII, FIXED, NOCCTL, STD

   BLK FACTOR: 10         CREATOR : CLERK

   REC SIZE: 80(BYTES)    LOCKWORD: KINU

   BLK SIZE: 80(BYTES)    SECURITY--READ    : ANY

   EXT SIZE: 8(SECT)                WRITE   : ANY

   NUM REC: 10                      APPEND  : ANY

   NUM SEC: 16                      LOCK    : ANY

   NUM EXT: 1                       EXECUTE : ANY

   MAX REC: 10                   ** SECURITY IS ON

   NUM LABELS: 0         FLAGS   :  NO ACCESSORS

   MAX LABELS: 0         CREATED :  MON, SEP 10, 1990,  7:21 PM

   DISC DEV  :15         MODIFIED:  THU, NOV 15, 1990,  9:54 PM

   CLASS     :DISC       ACCESSED:  THU, NOV 15, 1990,  9:54 PM

   SEC OFFSET:0          LABEL ADDR:  $000000D1 $001BC920

Along with file specification information, this screen displays the following:

  • name of the creator of the file

  • lockword assigned to the file, if any

To view the contents of a file from the system prompt

You can view the contents of a file using the PRINT command at the system prompt.

To view the entire file

To view the contents of a file, use the PRINT command followed by a file name.

  1. At the system prompt, enter PRINT followed by the file name.

  2. Press Return.

    The following example displays the contents of the YOURFILE file in your current group and account:

       :PRINT YOURFILE Return
    

    This example displays the contents of the file -- but only from the QTR1 group of the PAYABLE account.

       :PRINT TEMPREC.QTR1.PAYABLE Return
    

    If your file is longer than what can be shown on one screen, a pagebreak prompt appears. This prompt looks similar to the following:

       23/54 Continue?_
    

    Respond with Y or YES Return if you want to display the next screen page of the file. Respond with N or NO Return if you wish to stop the PRINT command and return to the system prompt.

    Note that the first number of the pagebreak prompt indicates the next line number to be displayed. The second number of the pagebreak prompt indicates the total number of lines in the document.

To view portions of a file

You can print certain portions of a file to the screen by specifying START= or END= line numbers. For example:

  • To display selected lines of a file on your screen, enter the PRINT command, and specify the file name and the starting and ending line numbers. The following example prints lines 1 through 10 of the MYFILE file:

       :PRINT MYFILE;START=1;END=10 Return
    
  • To display the end of the file, use the PRINT command without an ending line number. In the following example, all lines from line 170 to the end of the file MYFILE are displayed:

       :PRINT MYFILE;START=170 Return
    
  • To display a number of lines from the end of the file, specify the starting line number as a negative number. This signifies that the starting line number is to be calculated from the end of the file. In the following example, the last twenty lines of the file MYFILE are displayed:

       :PRINT MYFILE;START=-20 Return
    

Any problems?

  • Did the prompt disappear after using the PRINT command?

    Enter :eod (colon included) by itself on a new line and press Return. To prevent this from occurring again, always specify a file name when using the PRINT command.

  • Did you get the following error message?

       NONEXISTENT PERMANENT FILE (FSERR 52)
    
       THE PRINT COMMAND FAILED.  (CIERR 9080)
    

    This error message means that the file name that you are trying to access, is not recognized by the computer. Check to see if the file name is spelled correctly.

    Also, check that the file is in your logon group and account. If it is not, and you are the creator of the file, use the fully qualified file name.

  • Did you get this error message?

       SECURITY VIOLATION (FSERR 93)
    
       THE PRINT COMMAND FAILED.  (CIERR 9080)
    

    You are trying to print a file to which you do not have access. In this case, the creator of the file must release the file (see the RELEASE command, in the Command Reference - HP 3000 Series 9X8LX (B3820-90007) before you can print it.

To list the directories

You use the LISTFILE command to list directories as well as files. Directories are special types of files.

   :LISTFILE ./Directory1





   PATH=/YOURACCT/YOURGRP/./



   Directory1/

You can tell that it's a directory (rather than a file) in the command output because its name is followed by a slash.

To list all files and directories in your current working directory:

   LISTFILE ./@





   PATH=/YOURACCT/YOURGRP/./



   DIR2/         Directory1/   FILE1

All files (including directories) in your current working directory are listed.

If you omit the ./ from the command, the LISTFILE command assumes that you are looking only for MPE-named files, and HFS-named files are not displayed:

   :LISTFILE @



   FILENAME



   FILE1

If you have other files in the group where you are working, they are listed along with FILE1.

The result is the same if you omit @ and type LISTFILE since that is the default when no parameter is included with the command.

To list directories another way

NOTE: You can only use the system-provided UDCs, such as LISTDIR, if the system manager has activated them. Refer to the section "UDCs, JCL, Command Files, and Programs" in Chapter 3 for more information.

You can also use the LISTDIR UDC to list directories:

   :LISTDIR



   /YOURACCT/YOURGRP/DIR2/

   /YOURACCT/YOURGRP/Directory1/

All the directories in your current working directory are listed when you specify the UDC with no parameters.

You can also use the LISTDIR UDC to list directories in a specific location:

   :LISTDIR /SYS/PUB

This command locates any directories located in PUB.SYS.

To move to the directory

After you create a directory, you can move to it.

   :CHDIR ./Directory1

This command moves you to Directory1. Title not available shows you where you moved in the file system. Directory1 is now your current working directory.

Figure 2-1 Location after Changing Directories

[Location after Changing Directories]

Again, use a ./ to act on HFS files. If you don't, MPE/iX acts only on MPE-named files. If you try to change to Directory1 without the preceding ./ the system treats the directory name as an MPE name and converts the letters to uppercase. It does not locate the directory.

   :CHDIR Directory1



   File name is more than eight characters long. (CIERR 532)

According to MPE syntax, the file name is limited to eight characters, but actually, two errors occur here. First, the system discovers that the name is longer than eight characters and reports the error. Second, the name is upshifted, and the system looks for DIRECTORY1, which it wouldn't find even if it were fewer than eight characters.

To move back to your logon group

If you type

   :CHDIR

by itself, MPE/iX moves you back to your logon group. Try typing the command. Title not available shows you where you are now. YOURGRP is your current working directory again.

Figure 2-2 Moving Back to Your Logon Group

[Moving Back to Your Logon Group]