HPlogo Accessing Files Programmer's Guide > Chapter 14 Getting File Information

Displaying General File Information

MPE documents

Complete PDF
Table of Contents
Index

E0300 Edition 6 ♥
E0692 Edition 5

Some questions that you may wish to answer in this section include
  • Does a file by this name exist in my account or group?

  • How large is this file?

  • When and by whom was this file created?

  • What security provisions exist for this file?

You can use this information in an interactive context, or you can use commands and intrinsics within an executing program to obtain and utilize the information.

You use: To obtain information about:
LISTFILECharacteristics of a permanent file
LISTFILE...;TEMPCharacteristics of a temporary file
LISTEQFile equations in effect for current job or session

Displaying permanent file information with LISTFILE


The LISTFILE command is one of the most widely used commands in MPE/iX. You use LISTFILE to display information about one or more permanent files that you specify. LISTFILE has parameters that allow you to:
  • specify a set of permanent or temporary files that you wish information about

  • specify the amount, or level, of file information that you wish to see

  • specify a file where the LISTFILE output is written to

Specifying a file reference

If you do not indicate otherwise, LISTFILE displays information about all of the permanent files located in your logon group. You can optionally reference a file (or files) by specifying a file name and qualifying it with the appropriate group and/or account name. For example, if your logon group and account are MYGROUP.MYACCT, the following commands will return information about the same file:

   LISTFILE MYFILE
   LISTFILE MYFILE,MYGROUP
   LISTFILE MYFILE,MYGROUP,MYACCT

In addition, you can use MPE/iX wildcard characters, in conjunction with a qualified file reference, to specify a set of files you want LISTFILE to display information about. The wildcard characters you can use are
  • @ = zero or more alphanumeric characters

  • # = a single numeric character

  • ? = a single alphanumeric character

Specifying the list level

If you do not indicate otherwise, LISTFILE displays only the unqualified file name. You can optionally direct LISTFILE to display more detailed information about the file(s) that you specify, depending upon the parameter value that you specify in the command, as listed in Table 14-1 "Format Selection"

Table 14-1 Format Selection

Option Name Displayed Information
-2ACD Displays the file's ACD (access control definition). System managers can view the ACD for any file. Account managers can view the ACD for files in that account. File creators can view the ACD for their files. Other users can view an ACD only if that ACD specifies that the user has RACD (read ACD) access.
-1LABEL Displays the hexadecimal listing of the file label, including all lockwords. This level is available only to system managers and account managers.
0FILES Shows only the file name. This is the default.
1SUMMARY Displays the file name, file code, record size, record format, and other file characteristics such as ASCII or binary records, carriage-control option, current end-of-file location, and the maximum number of records allowed in the file.
2DISC Displays the file name, file code, record size, record format, and other file characteristics such as ASCII or binary records, carriage-control option, current end-of-file location, and the maximum number of records allowed in the file. It also displays the blocking factor, number of sectors in use, number of extents currently allocated, and the maximum number of extents allowed. LISTF, 2 also displays KSAM XL file types with "K", and KASAM64 with "K".
3DETAIL Displays the file name, record size, extent size, number of records, access rights for the user, and other file characteristics including the date created, modified, and last accessed. The creator, lockword, and label address are omitted. These can be obtained by specifying -3 if you have AM capability (for files in your account) or SM capability (for any file on the system).
4SECURITY Displays the security matrix for the file. This includes account-, group- and file-level security and the access rights for the user. If an access control definition exists (ACD), a message stating that fact is displayed.
5DATA Shows LISTFILE,3 data and all file-specific data in LISTF, 3 type format (that is, KSAM and SPOOL).
6QUALIFY Shows only fully qualified file name.
7UNIQUE Shows all file specific data in LISTFILE,3 type format, but does not show LISTFILE,3 data.
8ACCESS Shows all accessors for the file
9LOCKS Shows all format 8 data plus more details about the proecsses accessing the file, including locking data.
10SUMMARYWIDE The same basic information as in the SUMMARY option, but in a wider format to allow for larger values.
11DISCWIDE The same basic information as in the DISC option, but in a wider format to allow for larger values.

Specifying an alternate output file

If you do not indicate otherwise, LISTFILE sends its output to $STDLIST. You can optionally specify a different output file to which the file descriptions are written.

LISTFILE examples

  1. List all files in your logon account and group with file names that contain the characters "INFO":

    
      LISTFILE @INFO@
    
      INFOABST  INFOUTLN  INFOPREF  PSMGINFO  WINFOUTQ  XLINFO
    
    

  2. Show the file characteristics of all files with names beginning with "X" in a specified account and group:

    
      LISTFILE X@.INTRIN.LOZAR
    
      ACCOUNT=  LOZAR          GROUP=    INTRIN
    
      FILENAME    CODE ------------LOGICAL RECORD--- ----SPACE----
    
                  SIZE  TYP     EOF    LIMIT R/B   SECTORS -X  MX
      XLHPCICO     80B   FA      39      39    3       8    1   1
      XLHPCIDE     80B   FA      47      47    3       8    1   1
      XLHPCIGE     80B   FA      27      27    3       8    1   1
      XLHPCIPU     80B   FA      44      44    3       8    1   1
    
    

  3. Display the label information for a specified file:

    
      LISTFILE ODDITY,3
    
      ********************
      FILE: ODDITY.INFO.LOZAR
    
      FILE CODE : 1030      FOPTIONS: BINARY,FIXED,NOCCTL,STD
      BLK FACTOR: 1         CREATOR :
      REC SIZE: 256(BYTES)  LOCKWORD:
      BLK SIZE: 256(BYTES)  SECURITY--READ    : ANY
      EXT SIZE: 0(SECT)               WRITE   : ANY
      NUM REC: 7816                   APPEND  : ANY
      NUM SEC: 0                      LOCK    : ANY
      NUM EXT: 4                      EXECUTE : ANY
      MAX REC: 31250                **SECURITY IS ON
                            FLAGS   : n/a
      NUM LABELS: 0         CREATED : TUE, JUN  3, 1986, 9:47 AM
      MAX LABELS: 0         MODIFIED: TUE, JUN  3, 1986, 9:48 AM
      DISC DEV -: 0         ACCESSED: WED, JUN  4, 1986, 2:38 PM
      CLASS     : DISC      LABEL ADDR: $00000010 $00004414
      SEC OFFSET: 0
    
    

  4. Obtain a detailed ACD report on a file:

    
      LISTFILE FILEA,-2
    
      FILE = FILEA      ************** ACD ENTRIES **************
    
                        SAM.DOE            : R
                        JOE.DOE            : W
                        @.DESIGN           : NONE
                        @.@                : X
    
    

In order to display information about such large files, two new file format options have been introduced. The LISTF, LISTFILE, and LISTFTEMP commands will now support options 10 and 11. File format option 10 is the large file equivalent of file option "1", containing all the same information, but in a new format that allows for the expression of larger values. Similarly, the format option 11 is the large file equivalent of file option "2". Again, the same basic information is displayed, but the format has been changed to allow for a greater range of values to be displayed.The syntax of the LISTF, LISTFILE, and LISTFTEMP commands have not been changed with the addition of the new 10 and 11 format options. The same syntax can be used with the new values of 10 and 11 as the format. The output of the new formats will vary depending on whether or not MPE syntax names are being displayed or HFS syntax names are being displayed.The format for each of MPE and HFS syntax varieties of the new formats 10 and 11 can be seen from the examples shown below

  :listf @,10

  ACCOUNT=  SYS         GROUP=  EXAMPLE

  Name     Access FCode RecSiz Type            EOF    File Limit
  --------  ERWS  ----- ------ ----- ------------- -------------

  BIGFILE                 1024 FA                0    1023456789
  ICE       E     NMPRG    256 FB              832           832
  XKSM64                    80 FAk               1          1023
  XKSMXL                    80 FAK               1          1023
  XRAND      RW             80 FA              157           157
  XRAND2      W            252 VA              386            49
  YRAND           NMOBJ    256 FB               22          4000


  :listfile ./@,10
  
   PATH= /SYS/EXAMPLE/

  Access FCode RecSiz Type            EOF    File Limit Name
   ERWS  ----- ------ ----- ------------- ------------- --------

                 1024 FA                0    1023456789  BIGFILE
   E     NMPRG    256 FB              832           832  ICE
                   80 FAk               1          1023  XKSM64
                   80 FAK               1          1023  XKSMXL
    RW             80 FA              157           157  XRAND
     W            252 VA              386            49  XRAND2
         NMOBJ    256 FB               22          4000  YRAND


  :listf @,11                                              
  
  ACCOUNT=  SYS         GROUP=  EXAMPLE

  Name    Access FCode RecSiz Type     EOF File Limit Disk Usage Exts
  -------  ERWS  ----- ------ ----- ------ ---------- --------KB ----
  
  BIGFILE                1024 FA         0 1023456789          0    0
  ICE      E     NMPRG    256 FB       832        832        208    1
  XKSM64                   80 FAk        1       1023         64    1
  XKSMXL                   80 FAK        1       1023         52    1
  XRAND     RW             80 FA       157        157         16    1
  XRAND2     W            252 VA       386         49         16    1
  YRAND          NMOBJ    256 FB        22       4000          8    1


  :listfile ./@,11
  
   PATH= /SYS/EXAMPLE/

  Access FCode RecSiz Type     EOF File Limit Disk Usage Exts Name
   ERWS  ----- ------ ----- ------ ---------- --------KB ---- -------
   
                 1024 FA         0 1023456789          0    0 BIGFILE
   E     NMPRG    256 FB       832        832        208    1 ICE
                   80 FAk        1       1023         64    1 XKSM64
                   80 FAK        1       1023         52    1 XKSMXL
    RW             80 FA       157        157         16    1 XRAND
     W            252 VA       386         49         16    1 XRAND2
         NMOBJ    256 FB        22       4000          8    1 YRAND

The display for the format options 10 and 11 is the same for each of the LISTF, LISTFILE, and LISTFTEMP commands. One of the unique additions of these two new options is the the "ERWS" column. This column indicates whether or not the file is currently opened, and if so, for what type of access. An "E" in the E column indicates that the file is opened for Execute access, the "R" in the R column indicates that the file is opened for Read access, the "W" in the W column indicates that the file is opened for Write access, and the "S" in the S column indicates that the file is being Stored by the STORE or TurboSTORE utility. The column may have one or more of these characters specified, or none, depending on how the file is currently accessed.

Displaying temporary file information with LISTFILE...(;TEMP)


The LISTFILE...(;TEMP) command is similar to LISTFILE, except that it displays information about the specified temporary files. Syntax, parameters, and information displayed are the same as LISTFILE, with the following exceptions:

Its display of file information includes the word TEMPORARY or the abbreviation TEMP.

Displaying file equations with LISTEQ


The LISTEQ command allows you to list all file equations in effect for the job or session from which you issue the command. Here is an example of a LISTEQ call:

  LISTEQ

  FILE EQUATIONS

  FILE LP;DEV=PP;ENV=ELITE.XQENV.SYS;CCTL
  FILE OFFLINE;DEV=PP;ENV=ELITE.XQENV.SYS;CCTL
  FILE EDTLIST;DEV=PP;ENV=ELITE.ENV2680.SYS

If you do not indicate otherwise, LISTEQ sends its output to $STDLIST. You can optionally specify a different output file to which the file descriptions are written. For example, the following command sends output to the temporary file MYFILE:

  LISTEQ MYFILE




Chapter 14 Getting File Information


Retrieving Specific File Information