HP 3000 Manuals

Lesson 1 Introducing Files [ Using the 900 Series HP 3000: Advanced Skills Module 2: File Management ] MPE/iX 5.0 Documentation


Using the 900 Series HP 3000: Advanced Skills Module 2: File Management

Lesson 1 Introducing Files 

Introduction 

Lesson 1 presents the following information:

   *   LISTFILE parameters to display file information

   *   an introduction to permanent files

   *   an introduction to temporary files (user-defined and
       system-defined)

   *   An introduction to formal file designators

[]
Figure 2-1. File Types The MPE/iX file system controls the processing of all files, including their storage and transfer between various devices. Most of your work on the system involves files; therefore, you must know about the different kinds of files available for your use, as well as those used by the system. In general, the term "file" is used in MPE/iX in three ways: * permanent disk files * temporary disk files (both user-defined and system-defined files) * formal files (often called file "aliases") Permanent files Permanent files are sometimes referred to as "user files" since they are created directly by you, the user. You are probably already familiar with the file naming requirements, saving and purging commands, and basic LISTFILE commands to list your permanent files; however, as you continue to create and use more permanent files in MPE/iX, you need to know more about this kind of file, its characteristics, and how to get information about permanent files. LISTFILE command options Besides being able to provide you with sorted listings of permanent files within groups in your account, the LISTFILE command has a number option that can provide you with detailed information about any or all of your permanent files. The general form of the LISTFILE command is: LISTFILE filename, # Here, # represents an integer. Often, the LISTFILE printout can be quite long. You can press BREAK to return to a system prompt. Depending upon the syntax you use, the LISTFILE, # command gives you specific information: * for all files in your account LISTFILE @.@,# * for a single file in your current group LISTFILE filename,# * for a single file in a group other than your current group LISTFILE filename.groupname,# LISTFILE,1. Make sure that you are currently logged on to the CLASS group. Try entering this command from your keyboard: LISTFILE,1 What you should see is an alphabetical listing of files in your CLASS group with their logical record size information. How would you go about listing the same information only for MYFILE1? If you're in the CLASS group you only need enter the file name after the LISTFILE command. LISTFILE MYFILE1,1 Your display should look like this: _______________________________________________________________________ | | | | | ACCOUNT = xxxxxxxx GROUP = xxxxxxxx | | | | FILENAME CODE ---------------LOGICAL RECORD--------------- | | SIZE TYP EOF LIMIT | | | | MYFILE1 72B FA 18 18 | | | _______________________________________________________________________ The display shows that the SIZE of MYFILE1 is 72 bytes. It also notes that MYFILE1 is a fixed-length ASCII file (TYP) and currently holds 18 records. (EOF means the end of the file.) Can you get logical record information for the file, JOB1? Try that now. Which record size is larger, JOB1 or MYFILE1? (Compare the sizes.) Record size information is helpful when you want to join files together or use a word processing application to make changes to a file. If the application cannot accept the file, you see the message: ________________________________________________________________________ | | | CANNOT EDIT FILES OF THIS TYPE | | | ________________________________________________________________________
NOTE You can enter LISTFILE filename,SUMMARY to get the same display provided by LISTFILE filename,1.
LISTFILE,2. Suppose that you want to see how much space your files are occupying on the disk. Try the LISTFILE command with option 2 for files MYFILE1 and JOB1. LISTFILE MYFILE1,2 LISTFILE JOB1,2 Space information, expressed in terms of sectors, is provided in addition to the information from option 1. How would you modify this command so that you get information for all files in the PUB group of your account? Use wildcard options in the command. LISTFILE @.PUB,2 Enter this command from your keyboard now. There is only one file in the PUB group. The LISTFILE,2 command option clearly can help you track the amount of permanent space used by your files.
NOTE You can enter LISTFILE filename,DISC and get the same display provided by LISTFILE filename,2.
LISTFILE,3. LISTFILE,3 provides information on each file's structure, access codes, creation, and modification dates. For example, how would you find out when MYJOB2 was last modified? LISTFILE MYJOB2,3 Enter that now and review the information displayed on your screen. When was MYJOB2 created? Last modified?
NOTE You can enter LISTFILE filename,DETAIL and get the same display provided by LISTFILE filename,3. If you have SM capability, you can enter LISTFILE filename, 3;PASS and see the creator of the file and its lockword, if there is one.
-------------------------------------------------------------------------------------------- | | | Q2-1 Match the LISTFILE commands with the information that they display. | | | | | | LISTFILE,1 File structure, creation, and modification information | | | | LISTFILE,2 Logical record information | | | | LISTFILE,3 File space information | | | -------------------------------------------------------------------------------------------- LISTFILE,4. The purpose of the LISTFILE,4 option is to provide you with complete access information by account, group, and file, for each file in your current group. By entering LISTFILE,4 you see a display of information for all files in your current group. -------------------------------------------------------------------------------------------- | | | Q2-2 How would you modify the LISTFILE,4 command to list complete file access | | information for all files in your account? | | | | | --------------------------------------------------------------------------------------------
NOTE You can enter LISTFILE filename,SECURITY and get the same display provided by LISTFILE filename,4.
LISTFILE,5. The LISTFILE,5 command option normally shows exactly the same information displayed by LISTFILE,3. But if any of the files specified are KSAM or spool files, it displays information specific to those specialized files. Since no KSAM or spool files have been created in this lesson, LISTFILE,5 duplicates the LISTFILE,3 information.
NOTE You can enter LISTFILE filename,DATA and get the same display provided by LISTFILE filename,5.
LISTFILE,6. This is an easy one. The LISTFILE,6 command option provides you with an alphabetical listing of fully qualified file names. This command can be very helpful if you have a large account with many groups, and need to quickly find the group location of a particular file. Enter the LISTFILE command with option 6 to get a listing of all files in your account. Did you remember to include the wildcard option? If not, enter LISTFILE @.@,6
NOTE You can enter LISTFILE filename,QUALIFY and get the same display provided by LISTFILE filename,6.
LISTFILE,7. The LISTFILE,7 command option displays file information exactly the way that LISTFILE,6 does, But if any of the files specified are KSAM or spool files, LISTFILE,7 displays information specific to those specialized files. Since no KSAM or spool files have been created in this lesson, LISTFILE,7 duplicates the LISTFILE,6 information.
NOTE You can enter LISTFILE filename,UNIQUE and get the same display provided by LISTFILE filename,7.
LISTFILE,-1. The LISTFILE,-1 command provides you with hex information on your file(s). If you are a programmer or system manager, you may want to explore the displays of this LISTFILE option. Remember that the help facility describes the command parameters of the LISTFILE command.
NOTE LISTFILE,-1 requires AM capability. You can enter LISTFILE filename,LABEL and get the same display provided by LISTFILE filename,-1.
LISTFILE,-2. The LISTFILE,-2 command provides you with security information on specific files. It shows all of the access control definitions that are in effect for a particular file. You can use LISTFILE,-2 to see the access control definitions for the files you that have created. An account manager (AM) can use it to see the access control definitions for the files in the account she or he manages. A system manager (SM) can use LISTFILE,-2 to see the access control definitions for the entire computer system. In order to see the access control definitions for a file that someone else created, you must have RACD (Read and Copy ACD) permission for the that file you wish to examine; or you must have SM capability; or you must be the account manager (AM) of the account in which the file is found. Temporary files In contrast to permanent files, a temporary file is one that resides in the job or session temporarily, and exists no longer than the job or session that created it. Temporary files can be explicitly created by you, the user, or implicitly created by the system. User-defined temporary files are created with the TEMP option of the BUILD command. The BUILD command is discussed in lesson 2 of this module. System-defined files. System-defined temporary files are also referred to as "system files." These files are automatically created and named by the system. Two such files are $STDIN and $STDLIST. When you log on, your system automatically defines a file called $STDIN that corresponds to your input device, which is your keyboard. It also defines a file called $STDLIST to which the system sends output. $STDLIST refers to your terminal screen. System files are also automatically created during compiling and linking. These temporary files are used by the system to hold data generated during processing. For example, the different steps in compiling and linking a program create several $NEWPASS (output) files. $NEWPASS files automatically change to $OLDPASS (input) files when the files close at the completion of the process. Lesson 3 discusses temporary files. -------------------------------------------------------------------------------------------- | | | Q2-3 Have you noticed a unique characteristic of the names of system defined | | files? | | | | | -------------------------------------------------------------------------------------------- You can also create a temporary file to hold the output from a LISTFILE command. Enter the following command at your keyboard: LISTFILE,6 > FILELIST The > instructs MPE/iX to create a temporary file and enter the output from the command into that temporary file. FILELIST contains the file listing generated by LISTFILE,6. The > redirection of output works with any of the LISTFILE options and with almost every other MPE/iX command. To view this temporary file, enter: PRINT FILELIST PRINT displays the first 23 lines of the file and pauses. It shows the number of the next line to be displayed and the number of the last line in the file, and it asks if you want to continue with the display. You see something like this on the bottom line of your screen: _______________________________________ | | | | | (24/37) Continue? | | | _______________________________________ The next line to be shown is 24. The last line that can be displayed is 37. Press RETURN each time you want to see another 23 lines of the file. If instead you want to see a particular line, enter that line number and press Return: _______________________________________ | | | | | (24/37) Continue? 31Return | | | _______________________________________ In this example, PRINT would display line 31 and the next 22 lines following it. If you do not want to see more of the file, enter N (for No) and press Return. Listing temporary files How do you list temporary files? Use LISTFILE;TEMP. Enter that now and see if there are any temporary files in your account. LISTFILE;TEMP Unless you have been doing some programming or creating additional temporary files, you should only see the FILELIST that you just created. ________________________________________________________________________ | | | TEMPORARY FILES FOR USERx.ACCTx,CLASS | | | | FILELIST.CLASS.ACCTx | | | ________________________________________________________________________ Purging temporary files Purging temporary files is done with the PURGE command as follows: PURGE filename,TEMP Enter this command now to purge FILELIST. PURGE FILELIST,TEMP Formal files Formal files differ from permanent and temporary files in that they do not exist on tape or on disk; however, they follow the same file naming conventions as permanent files. A formal file is an alternate label, or alias. It is a name used by a program or in a file equation and it refers to another actual file or device. This name is referred to as a file designator. A common example of a formal file that you might use one day is the EDTLIST file in the following equation: FILE EDTLIST;DEV=LP The EDTLIST file is now the designated file alias for the line printer (LP). Because this formal file refers to a device, it is often referred to as a "device" file. Listing file equations Since formal files are not stored on disk, they cannot be listed with the LISTFILE command; however, file equations using formal file designators can be listed with the LISTEQ command. Enter the example of a file equation presented earlier: FILE EDTLIST;DEV=LP Now enter LISTEQ to list the formal files on your system. LISTEQ You should see the following: ________________________________________________________________________ | | | FILE EQUATIONS FILE EDTLIST;DEV=LP | | | ________________________________________________________________________ On some systems, you might also see additional file equations: ________________________________________________________________________ | | | FILE MAILPRNT;DEV=LP;ENV=ELITE.HPENV.SYS FILE | | SLLIST;DEV=LP;ENV=ELITE.HPENV.SYS | | | ________________________________________________________________________ Each of the file designators listed, MAILPRNT and SLLIST, refers to a device. Lesson 4 provides more information regarding these file designators. -------------------------------------------------------------------------------------------- | | | Q2-4 What is similar about the file naming characteristics of formal and | | permanent files? | | | | | -------------------------------------------------------------------------------------------- Lesson summary 1. Use the LISTFILE,# options to get information on your account files: LISTFILE,1 Logical record information LISTFILE,-1 Hex information LISTFILE,2 File space information LISTFILE,3 Creation, modification, access information LISTFILE,4 User access information LISTFILE,5 Like 3, but adds KSAM or spool file information LISTFILE,6 Fully qualified file names LISTFILE,7 Like 6, but adds KSAM or spool file information 2. Permanent files are stored on disk and can be listed with the LISTFILE command. 3. Temporary files are created by the system or users, are stored on disk and are listed with the LISTFILE;TEMP command. 4. Formal files are designated file aliases and can be listed with the LISTEQ command. Exercise 2-1:lesson 1 review. 1. Check your understanding of the characteristics of permanent, formal, and temporary files by noting to which file type(s) each characteristic applies. ------------------------------------------------------------------------------------------------- | | | | | | Characteristic | Permanent | Formal | Temporary | | | | | | ------------------------------------------------------------------------------------------------- | | | | | | a. File names are 1-8 characters | | | | | long. | | | | | | | | | | b. File names are aliases for | | | | | devices. | | | | | | | | | | c. File names may begin with a $. | | | | | | | | | | d. Files may be listed with | | | | | LISTFILE. | | | | | | | | | | e. Files may be listed with | | | | | LISTEQ. | | | | | | | | | | f. File names must begin with an | | | | | alpha character. | | | | | | | | | | g. File names are listed with | | | | | LISTFILE;TEMP. | | | | | | | | | ------------------------------------------------------------------------------------------------- 2. From each pair of commands, select the correct LISTFILE command that displays the information requested. ----------------------------------------------------------------------------------------- | | | a. Logical record and space allocation LISTFILE @.@,2 or | | for all files in account. LISTFILE @.@,3 | | | | b. Hex information for MYJOB1 (requires LISTFILE MYJOB1,-1 or LISTFILE | | AM capability). MYJOB1,7 | | | | c. Logical record information for MYJOB1 LISTFILE MYJOB1,1 or LISTFILE | | file. MYJOB1,-1 | | | | d. Creator information for all files in LISTFILE,3 or LISTFILE,5 | | your current group (requires AM | | capability). | | | | e. All files within your logon group. LISTFILE or LISTFILE @.@,1 | | | | f. Complete access and lockword LISTFILE,3;PASS or LISTFILE,4 | | information for all files in your | | current group (requires SM | | capability). | | | | g. Fully qualified file names for all LISTFILE @.@,6 or LISTFILE @.@,2 | | files in your account. | | | | h. Creation, access, and modification LISTFILE @.PUB,3 or | | information on files in the PUB group LISTFILE @.PUB,1 | | of your account. | | | | i. KSAM or spool file information for LISTFILE,7 or LISTFILE,5 | | those specialized files. | | | ----------------------------------------------------------------------------------------- ********** End of Exercise 2-1 ***********


MPE/iX 5.0 Documentation