Using HP 3000 MPE/iX:\Advanced Skills Tutorial: HP 3000 MPE/iX Computer Systems > Chapter 4 Module 3: Batch ProcessingLesson 2 Examining a Job File |
|
Lesson 2 provides the following information about the structure and use of a job file:
In this lesson, you will examine a sample job file to see how job files are organized and what kinds of commands are used within these files. Start the editor and list the MYJOB (job) file to your screen. (MYJOB is in the CLASS group of your account.) This file contains examples of commands used in this lesson. The editor commands and job listing appear below.
MYJOB listing:
Job files are generally created by using an editor or a word processor and may consist of four types of command:
You will learn about user-defined commands and command files in module 5, "UDCs and Command Files." These five MPE/iX commands are used almost exclusively in job/batch files are:
When MPE/iX commands appear in a job file, they must be preceded by an exclamation point (!). The ! tells the system that what follows should be treated as an MPE/iX command. Each of these commands is described and explained in both the MPE/iX Commands Reference Manual Volumes 1 and 2 (32650-90003 and 32650-90364) and the Help facility. Select either resource for more information on the purpose and parameters of each of the commands as they are explained in this lesson. !JOB MYJOB1,USERx/UPASSx.ACCTx/APASSx,& !CLASS;INPRI=9;RESTART;OUTCLASS=LP,1;SPSAVE
Every job file requires the inclusion of a !JOB command. The purpose of the JOB command is to initiate a batch job. It is always the first executable line of any job and contains additional information regarding the location of the file materials, user and account names, and so on. (The JOB command is to batch processing what the HELLO command is to interactive processing.) By using the required and optional parameters of the JOB command, you tell the system that the commands that follow should be executed as a job. Which of the JOB command parameters are required? Which are optional? Use your reference source and mark this information in the following table. Table 4-1 Q3-14
!JOB MYJOB1,USERx/UPASSx.ACCTx/APASSx,CLASS; Most JOB commands begin with the name of the job followed by the user name, account name, and logon group name. While not required, including the name of a job file in a JOB statement can provide for easy identification of the file. Unlike sessions, where MPE/iX prompts for passwords, job files mustcontain the required user, account, and group passwords to work. Therefore, the passwords (if any) for the user, account, and group must follow each of these names. Notice that the passwords must be joined to the user, account, or group name by a backslash (/): !JOB...USERx/UPASSx.ACCTx/APASSx....
!JOB MYJOB1...;INPRI=9... Remember the importance of the input priority? The input priority (INPRI) must be greater than the current jobfence in order for a job to execute. What is the input priority for MYJOB? It is 9. If you were going to run MYJOB now on your system, would it run? (Use SHOWJOB to check the jobfence on your system to find out.) !JOB MYJOB1,USERx/UPASSx...;RESTART;... The RESTART parameter ensures that a job will restart in the event of a system halt and start. A job with this parameter restarts processing from the beginning; however, no work already done will be undone.
!JOB MYJOB1...;OUTCLASS=LP,1 The OUTCLASS parameter refers to a "job listing," not to the actual finished result you expect from a job. This parameter lets you set the following:
Outclass priority values range from 1 (low) to 13 (high). The output priority value must be set above the system outfence value in order to enable the job listing to print. To check on the current outfence value for your system enter:
In order for a job listing to print, the outclass priority must be set above the system's outfence value.
A $STDLIST spool file is generated when you run a job. It is usually destined for the printer when the job has executed. Normally, the spool file is automatically erased after it is printed. The optional ;SPSAVE parameter instructs the system to save the $STDLIST spool file until you or the system manager explicitly purge it. A low output priority may prevent a spool file from printing, and the spool file will appear to be saved; but the spool file will disappear after it is allowed to print. The ;SPSAVE option, however, saves the spool file after printing. Saving a spool file can be useful for a job that is likely to execute quickly. By saving the spool file, you ensure yourself the opportunity of examining it with the PRINT command. MYJOB is a small job and, if the system is not very busy, will execute quickly.
!COMMENT MYJOB1 PRINTS MYFILE1 The COMMENT command inserts a comment into the command stream. The purpose of the comment is for the benefit of the user, since no execution is done. Comments may appear anywhere in a job file. Including a comment regarding the purpose of a job can be helpful when you have multiple users of a single job. !CONTINUE How do you avoid a job aborting when it encounters an error? The CONTINUE command enables a job to continue to process if it appears immediately before a command line that may cause an error during a job's processing; therefore, the job continues to execute even if an error occurs, and the job listing contains the error message where the error occurred. Look at line 4 in MYJOB. Inserting the CONTINUE command on this line ensures that if the system encounters a problem with line 5, the job will not abort there. !TELL USERx.ACCTx MYJOB1 IS DONE The TELL command can be inserted at one or more points in the job to send reports to the screen indicating your job's progress. The TELLOP command is used to alert system operators to perform some action regarding the job such as loading a tape or changing paper on the printer.
!EOJ The !EOJ command terminates a job and displays the following information on the job's printout: CPU time (in seconds), time elapsed since the beginning of the job, and the date and time. The !EOJ command is on the last line in a job file. Some jobs may involve the use of a word processor or other kind of application or utility, for example EDIT/3000 or SORT. Any application that normally executes from a system prompt can be included in a job file preceded by an exclamation point:
Notice that after the editor is invoked (!EDITOR), the EDIT/3000 commands are entered in the job file exactly the way you would enter them if you were using the editor interactively at your terminal: T MYFILE1 and LIST ALL, OFFLINE. These commands are internal to the application (the editor) and must not have the ! ahead of them
Here's a chance to check your own knowledge about batch processing commands and their use. Suppose that you have been given the following jobfile (MYJOB2). This job lists the contents of a text file titled MYFILE2; however, the job file needs to be modified in order to run correctly. Use the editor to access and list MYJOB2 on your screen. (This file should be in your account.)
MYJOB2 File
********** End of Exercise 3-2 **********
|