HPlogo Using HP 3000 MPE/iX:\Advanced Skills Tutorial: HP 3000 MPE/iX Computer Systems > Chapter 4 Module 3: Batch Processing

Lesson 2 Examining a Job File

» 

Technical documentation

Complete book in PDF
» Feedback

 » Table of Contents

 » Glossary

 » Index

Introduction

Lesson 2 provides the following information about the structure and use of a job file:

  • job commands and how they are used

  • input and output processing and printing priorities

  • Modifying 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.

Figure 4-1 Examining a Job File

[Examining a Job File]

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.

   EDITOR

   /T MYJOB1

   /L ALL

MYJOB listing:

   1    !JOB    ``MYJOB1,USERx/UPASSx.ACCTx/APASSx,CLASS;&

   2    !INPRI=9;RESTART;OUTCLASS=LP,1;SPSAVE

   3    !COMMENT MYJOB1 PRINTS MYFILE1

   4    !CONTINUE

   5    !EDITOR

   6    T MYFILE1

   7    L ALL,OFFLINE    

   8    EXIT

   9    !TELL USERx.ACCTx  MYJOB1 IS DONE

   10   !EOJ

Job files are generally created by using an editor or a word processor and may consist of four types of command:

  • MPE/iX batch processing commands

  • other MPE/iX commands

  • user-defined commands (UDC) and command files (module 5)

  • application commands (optional)

You will learn about user-defined commands and command files in module 5, "UDCs and Command Files."

Batch processing commands

These five MPE/iX commands are used almost exclusively in job/batch files are:

CommandLine Number in MYJOB File
JOB 1
COMMENT 3
CONTINUE 4
TELL 9
EOJ10

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 command

!JOB MYJOB1,USERx/UPASSx.ACCTx/APASSx,&

!CLASS;INPRI=9;RESTART;OUTCLASS=LP,1;SPSAVE

NOTE: When a JOB command is too long to be written on one physical line on the screen, it may be continued onto succeeding lines. To show the continuation, an ampersand (&) is entered at the end of the each physical line. Each line of the continued command must begin with an exclamation point (!). A command continued over several lines with & may consist of as many as 279 characters, including spaces and ampersands, but not including the ! in the column one position.

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 ParameterRequiredOptional
User Name  
Account Name  
Group Name  
Job Name  
Time  
INPRI  
RESTART  
OUTCLASS  
SPSAVE  

 

Hint

HELP JOB

User/account names/passwords

!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....

Q3-15What are the job name, user name, account name, and group name specified in the JOB command in the MYJOB file?
Q3-16If the password for the CLASS group is LASER, will the job run with the JOB command stated as is?

Input priority

!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.)

RESTART parameter

!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.

NOTE: RECOVERY Option

Your system operator may choose to restart a system with either the RECOVERY or the NORECOVERY option. RECOVERY is the default option, and it ensures that all jobs that include the RESTART option will be restarted. It also ensures the starting of any job that had not yet started at the time of the system halt.

No jobs of any kind are restarted if the system is brought back up with the NORECOVERY option.

Q3-17What happens to your job if your system crashes and you do not have the RESTART parameter in your JOB command?

OUTCLASS parameter

!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:

  • device where the job listing is to be printed.

  • job listing's outclass priority.

  • number of copies of the job listing to be printed.

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:

   SHOWOUT

In order for a job listing to print, the outclass priority must be set above the system's outfence value.

NOTE: The job listing is a copy of the step-by-step processing of the job. Most users suppress the printing of the job listing unless the job has previously experienced some problems executing. When problems occur, review the job listing to find where the error(s) occurred.

SPSAVE parameter

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.

Hint:

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.

Q3-18Assuming that the system outfence value is set at 6, which !JOB command ensures that the job listing will print?
 a. !JOBx........INPRI=9;OUTCLASS=LP,5
 b. !JOBx........INPRI=9;OUTCLASS=LP,6
 c. !JOBx........INPRI=9;OUTCLASS=LP,8
Q3-19

Where will the job listing from MYJOB appear?

Given a system outfence value of 4, will the job listing for MYJOB print?

COMMENT command

!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 command

!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 command and TELLOP command

!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.

Q3-20What prints on USERx's screen when MYJOB completes processing?

EOJ command

!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.

Other commands in job files

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:

   !EDITOR

   !SORT

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

Q3-21What is the purpose of the !EDITOR line in MYJOB?
Q3-22What is the purpose of the T MYFILE1 line in MYJOB?

Exercise 3-2: modifying the MYJOB2 file

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.)

   EDITOR

   /T MYJOB2

MYJOB2 File

   1  !JOB MYJOB2,USERx.FINANCE/PW,PUB;&                   

   2  !INPRI=2;OUTCLASS=LP,8;SPSAVE

   3  !COMMENT MYJOB2 PRINTS MYFILE2

   4  !EDITOR

   5  T MYFILE2.NEWS

   6  L ALL,OFFLINE

   7  EXIT

   8  !EOJ
  1. Modify the JOB command to show your user and account name as well as your passwords.

  2. Verify the current jobfence. Modify the input priority in the JOB command to a value that enables the job to run.

  3. You want to be sure that should the system halt while the job is processing, the processing restarts when the system is restarted. Enter that parameter in the JOB command to ensure that this happens.

  4. Suppose that several times in the past a user has encountered some problems in processing MYFILE2. Therefore, you want to check the job listing before it is printed.

    Verify the current system outfence:

       SHOWOUT
    

    Modify the OUTCLASS parameter to a value that ensures that the job listing will not print.

  5. MYFILE2 is now located in the CLASS group in your account. Modify the appropriate lines in the job file to reflect MYFILE2's correct location.

  6. Add a line in the job file to provide a screen message noting that your job has completed processing.

  7. Check over the file once again to ensure that all JOB commands are preceded by an exclamation point (!)

  8. Check your modifications against those in the Solutions Guide. Then process MYJOB2 by entering

       STREAM MYJOB2
    

    If all the changes were made correctly, you should soon see a message similar to this:

       FROM/Jxx USERx.ACCTx  MYJOB2 IS COMPLETE
    

    Two sorts of errors can occur the jobs you have been working with.

    • The STREAM command detects a significant error in the job file itself--a missing or invalid !JOB command; a missing or invalid password; account or groupname; a missing or invalid device specification.

      Such errors will be reported on your screen. If the error is serious, the stream or the job execution may fail.

    • In the jobs that you have used so far, the editor detects an error--an invalid file name; an editor command to change something not found in your text.

      Such errors will turn up in your job listing.

    That is why it is a good idea to specify ;SPSAVE in your !JOB command line. That way, you can use the PRINT command to examine your spool file to see what error the editor encountered. (In a later section, you will learn how to use LISTSPF and the PRINT command to check for errors.)

********** End of Exercise 3-2 **********

Lesson summary

  1. The JOB command initiates a batch job and contains required information regarding the location of the relevant files, user and account names, and processing priority.

  2. A job must have an input priority higher than the current jobfence in order to begin processing.

  3. The job listing prints only if the job's output priority is above the outfence priority.

  4. The CONTINUE command ensures that a job will continue to process if it appears before a command line that may cause an error during the job's processing.

  5. The RESTART parameter ensures that an executing job will restart in the event of a system halt and system start, provided that the system is restarted with the RECOVERY option.