HPlogo Using KSAM XL and KSAM 64 > Chapter 3 Obtaining File Information

Displaying File and Key Information

MPE documents

Complete PDF
Table of Contents
Index

E0300 Edition 4 ♥
E0394 Edition 3

Use the LISTFILE command to display the file specifications used to build the file. This command lists descriptions of one or more disk files at the level of detail you select. The level of display detail is controlled by the option number or keyword parameter followingthe file name.

A KSAM XL file does not have a unique file code. The file's structure can be discerned from a LISTFILE display using option 1 (SUMMARY) or 2 (DISC). When displayed in this manner, the character K is appended to the file type of a KSAM XL or a KSAM64 file to distinguish them from standard files. A file code of KSAM identifies a CM KSAM data file. A file code of KSAMK identifies a CM KSAM key file. The following example displays summary information for a KSAM XL file, a CM KSAM key file, a CM KSAM data file, a KSAM64 file, and a standard file.

Figure 3-1 File Type Display

  :LISTFILE,1
  ACCOUNT=       AR            GROUP=        MGR

  FILENAME   CODE   ------------LOGICAL RECORD-------
                      SIZE  TYP        EOF      LIMIT

  ARMSTRXL            160B  FAK          0        115
  EMPKEY     KSAMK    128W  FB        1742       1742
  EMPLOYEE   KSAM     256B  FA           0       1023
  ARMSTR64            160B  FAK          0        115
  CLIENT               80B  FA           1          1

Two options display the key specifications for a KSAM file. Option 5 (DATA) displays the file specifications and key data for the file. Option 7 (UNIQUE) displays information that is unique to the file type. For KSAM files, this displays the key data without the file specifications.

Figure 3-2 "File Information Display for a KSAM XL File" provides an example of the LISTFILE command using option 5 (DATA) and the display it generates.

Figure 3-2 File Information Display for a KSAM XL File


  :LISTFILE ARMSTRXL.MGR.AR,5
  ***************************
  FILE: ARMSTRXL.MGR.AR

  FILE CODE : 0                  FOPTIONS: ASCII,FIXED,NOCCTL,KSAMXL
  BLK FACTOR: 1                  CREATOR : **
  REC SIZE: 160(BYTES)           LOCKWORD: **
  BLK SIZE: 160(BYTES)           SECURITY--READ    : ANY
  EXT SIZE: 0(SECT)                        WRITE   : ANY
  NUM REC:  0                              APPEND  : ANY
  NUM SEC:  2160                           LOCK    : ANY
  NUM EXT:  2                              EXECUTE : ANY
  MAX REC:  115                          **SECURITY IS ON
                                 FLAGS   : n/a
  NUM LABELS: 0                  CREATED : MON, NOV 13, 1989,  3:35 PM
  MAX LABELS: 0                  MODIFIED: MON, NOV 13, 1989,  3:35 PM
  DISC DEV #: 16                 ACCESSED: MON, NOV 13, 1989, 10:15 PM
  CLASS     : DISC               LABEL ADDR: **
  SEC OFFSET: 0

  KEY         KEY TYPE        KEY LOCATION   KEY SIZE   DUP\RDUP

    1         NUMERIC                    4          6   NONE
    2         BYTE                      10         25   RDUP
    3         NUMERIC                   65          5   RDUP
    4         BYTE                      70          3   RDUP

  NUM KSAM KEYS: 4                         FIRST KSAM RECORD: 1
  LANGUAGE     : ENGLISH                   REUSE RECORDS    : YES
  PRIMARY KEY  : RANDOM                    COBOL            : NO
  VERSION      : 2                         COMPUTEBLK SIZE  : OPTMBLK

Figure 3-3 File Information Display for a KSAM64 File

  :LISTFILE ARMSTR64.MGR.AR,5
  ***************************
  FILE: ARMSTR64.MGR.AR

  FILE CODE : 0                  FOPTIONS: ASCII,FIXED,NOCCTL,KSAMXL
  BLK FACTOR: 1                  CREATOR : **
  REC SIZE: 160(BYTES)           LOCKWORD: **
  BLK SIZE: 160(BYTES)           SECURITY--READ    : ANY
  EXT SIZE: 0(SECT)                        WRITE   : ANY
  NUM REC:  0                              APPEND  : ANY
  NUM SEC:  2160                           LOCK    : ANY
  NUM EXT:  2                              EXECUTE : ANY
  MAX REC:  115                          **SECURITY IS ON
                                 FLAGS   : n/a
  NUM LABELS: 0                  CREATED : MON, NOV 13, 1989,  3:35 PM
  MAX LABELS: 0                  MODIFIED: MON, NOV 13, 1989,  3:35 PM
  DISC DEV #: 16                 ACCESSED: MON, NOV 13, 1989, 10:15 PM
  CLASS     : DISC               LABEL ADDR: **
  SEC OFFSET: 0

  KEY         KEY TYPE        KEY LOCATION   KEY SIZE   DUP\RDUP

    1         NUMERIC                    4          6   NONE
    2         BYTE                      10         25   RDUP
    3         NUMERIC                   65          5   RDUP
    4         BYTE                      70          3   RDUP

  NUM KSAM KEYS: 4                         FIRST KSAM RECORD: 1
  LANGUAGE     : ENGLISH                   REUSE RECORDS    : YES
  PRIMARY KEY  : RANDOM                    COBOL            : NO
  VERSION      : 2                         COMPUTEBLK SIZE  : OPTMBLK

For a KSAM file, the file specifications, as well as the key information specified when the file was built, is displayed. (Note that the keyword DATA could have replaced the option number 5 in the LISTFILE request in the preceding example.) This display could be abbreviated to display only the key data by using option 7 (UNIQUE) as shown in Figure 3-4 "Key Information Display for a KSAM XL File"

Figure 3-4 Key Information Display for a KSAM XL File

  :LISTFILE ARMSTRXL.MGR.AR,7
  **************************
  FILE: ARMSTRXL.MGR.AR

  KEY         KEY TYPE        KEY LOCATION   KEY SIZE   DUP\RDUP

    1         NUMERIC                    4          6   NONE
    2         BYTE                      10         25   RDUP
    3         NUMERIC                   65          5   RDUP
    4         BYTE                      70          3   RDUP

  NUM KSAM KEYS: 4                         FIRST KSAM RECORD: 1
  LANGUAGE     : ENGLISH                   REUSE RECORDS    : YES
  PRIMARY KEY  : RANDOM                    COMPUTE BLK SIZE : OPTMBLK
  VERSION      : 2

Figure 3-5 Key Information Display for KSAM64 File

  :LISTFILE ARMSTR64.MGR.AR,7
  **************************
  FILE: ARMSTR64.MGR.AR

  KEY         KEY TYPE        KEY LOCATION   KEY SIZE   DUP\RDUP

    1         NUMERIC                    4          6   NONE
    2         BYTE                      10         25   RDUP
    3         NUMERIC                   65          5   RDUP
    4         BYTE                      70          3   RDUP

  NUM KSAM KEYS: 4                         FIRST KSAM RECORD: 1
  LANGUAGE     : ENGLISH                   REUSE RECORDS    : YES
  PRIMARY KEY  : RANDOM                    COMPUTE BLK SIZE : OPTMBLK
  VERSION      : 4




Chapter 3 Obtaining File Information


Accessing File Information from a Program