Using HP 3000 MPE/iX:\Advanced Skills Tutorial: HP 3000 MPE/iX Computer Systems > Chapter 4 Module 3: Batch ProcessingLesson 3 Creating and Streaming a Job File |
|
Lesson 3 presents the following MPE/iX job-related tasks:
Up to this point you have worked with existing job files, examining them and modifying them. You will now create your own job files to perform specific tasks. Later in this lesson, you will actually stream the job files that you created and look at the results. You've had the chance to examine and modify a job file. Now, you will step through an exercise that shows you how to create job files. As you follow along, make sure that you are logged on as USERx.ACCTx in the CLASS group, where X = your student number. You will be creating two job files according to specifications. These jobs will be streamed at a later time.
********** End of Exercise 3-3 ********** Now that you have had the chance to create job files on your own, let's learn what you can do to get those jobs to execute. The process of doing this is called streaming a job. This is accomplished with the STREAM command. The STREAM command has options that allow you to actually specify the time and date that you wish a job to run.
Type this simple version of the STREAM command using the JOB1 file:
You will notice that the job number (#Jxxx) appears on the screen. Note this number. JOB1 immediately enters the job queue and executes when system resources are available. It will execute exactly as specified in the job file, as if you were entering the commands contained within it at the terminal.
Now suppose that you wish the job to execute late at night at a particular time when system resources are more available. Please enter the following STREAM command to specify an exact time for your job to run after hours (specify a time at least one hour later than the current time):
In the example above, the job will run at 3:00 A.M. It will print several copies of a previous lesson later in the early morning.
There are several other options that you can specify with the STREAM command: STREAM jobname;AT= Lets you specify a time to run the job. ;DAY= Lets you specify a day to run the job. ;DATE= Lets you specify a date to run the job. ;IN= Lets you specify a relative time, day, or date to run the job (for example, two hours from now, or two days from now). See the following figure for examples of the various options. These options are explained in depth in the MPE/iX Commands Reference Manual Volumes 1 and 2 (32650-90003 and 32650-90364) and in the Help facility, under the STREAM command. If you specify a job start at 3:00 PM (15:00) and it is now 3:01 PM, your job will start at 3:00 PM the next day. For a greater understanding of these options, study the following examples: Match the descriptions in the following table with the correct STREAM command. (Assume it is Sunday, August 1, 1989, at 6:00 A.M., and jobs are currently executing on the system.) Table 4-2 Q3-26
After you enter the STREAM command, you may decide that you do not wish the job to execute. This may happen if you discover a text error in a file that you were planning to format, or in a program you were planning to run. In this case, you should abort the job. The following command does this:
Determine whether JOB1 has finished executing. If it has not, use ABORTJOB #Jjobnumber. The job number should be the one you noted earlier. If the job has already completed, enter the following command.
Note the resulting job number that displays after you enter the command. Verify that the job is processing by entering the following command (note the job number):
Now abort the job using the job number and do a SHOWJOB again to verify that the job no longer exists.
The processed part of the job still prints out (whatever part of it was processed) even if you use ABORTJOB. In the next lesson you will learn how to prevent this from happening.
Occasionally, after streaming a job, you may decide that the system resources are such that it will take too long to run the job (perhaps many other jobs are also running simultaneously and the CPU has to swap between them all). Rather than aborting your job and then restreaming it later, you can suspend it with the BREAKJOB command and resume it with the RESUMEJOB command:
Take Care. A job may involve accessing databases or files that become locked during access. If you do a BREAKJOB while executing such a job, you run the risk of preventing others from accessing those databases or files. This is due to the fact that while your job is suspended, the locks remain on the databases or files that were previously being accessed. This can have detrimental effects on other users. Please be aware of the function of a job before you suspend or abort it. By doing this, you do not lose any of the job processing you have accomplished. Plus, you do not lose your place in the job processing queue. All that happens is that system resources are freed to process other jobs ahead of you (so that less "swapping" has to occur). Once you see that those jobs are done, you can resume your job with the RESUMEJOB command. Jobs that are suspended are listed as being in the SUSP state when you do a SHOWJOB.
If a job is in INTRO, WAIT or SCHED state (has not run yet), you can alter its input priority or output device with the ALTJOB command:
Make sure that JOB1 has completed. If it is still running, abort it. Now, test the ALTJOB command by restreamingJOB1:
Note the job number. Try to change the input priority to 13. What happens? You'll find that you cannot ALTJOB because the job is currently in the EXEC state. You must be in the INTRO, WAIT, or SCHED state. To terminate JOB1, abort it:
Now, return to the editor and modify the JOB1 file so that the input priority is reduced to 1. Keep the file and restream JOB1:
Finally, abort the job so that it neither continues processing, nor prints (remember, it only has an output priority of 5, which defers printing).
Using ALTJOB is a good way to ensure that a job runs, even if initially you set the input priority to a very low number. Also, suspending the job prevents it from continuing and from printing. In the next lesson, you'll learn how to purge the spool files that remain from suspended jobs that you no longer wish to resume.
|