february, - mit

132
A JOB QUEUEING PROGRAM FOR THE MANAGEMENT INFORMATION SYSTEMS COURSES by RICHARD ERIC DENKER SUBMITTED IN PARTIAL FULFILLMENT OF THE REQUIREMENTS FOR THE DEGREE OF BACHELOR OF SCIENCE at the MASSACHUSETTS INSTITUTE OF TECHNOLOGY February, 1980 Signature of Author: Departmejaf o me_± - -ngineering and Corn-iter Science, January 16, 1980 Certified b ............ Thesis Supervisor Accepted by: . . . r.. .. . . .. ..-.. .. .. Chairman, Departmental Committee on Theses

Upload: others

Post on 19-Mar-2022

0 views

Category:

Documents


0 download

TRANSCRIPT

A JOB QUEUEING PROGRAM FOR THE

MANAGEMENT INFORMATION SYSTEMS COURSES

by

RICHARD ERIC DENKER

SUBMITTED IN PARTIAL FULFILLMENT

OF THE REQUIREMENTS FOR THE

DEGREE OF BACHELOR OF SCIENCE

at the

MASSACHUSETTS INSTITUTE OF TECHNOLOGY

February, 1980

Signature of Author:Departmejaf o me_± - -ngineering and

Corn-iter Science, January 16, 1980

Certified b ............Thesis Supervisor

Accepted by: . . . r.. .. . . .. ..-.. .. ..Chairman, Departmental Committee on Theses

A JOB QUEUEING PROGRAM FOR THE

MANAGEMENT INFORMATION SYSTEMS COURSES

by

RICHARD ERIC DENKER

Submitted to the Department of Electrical Engineering andComputer Science in January, 1980, in partial fulfillmentof the requirements for the Degree of Bachelor of Science.

ABSTRACT

The Management Information Systems courses of the SloanSchool are currently done by batch processing and card deck input.This program will make enhancements to this system to make studentinput more convenient. Basically it will do this by automating thefunctions that are currently performed by the course teaching assistants.The operation of the program will be to monitor a specific file that canbe input into using the card reader. The student will read a properlyformatted deck into the card reader, receiving error feedback if theprogram cannot accept the input, and then the program will append thejob to the correct file for that machine problem. The program willperiodically check to see if enough jobs have been input for a batch run,or if a time of day to batch all jobs has been reached. If a machineproblem is ready to be run, the program will format the file correctlyand then submit it to the Information Processing Center. This programwill free the teaching assistants from this work, and be able to performthese functions more efficiently.

Thesis Supervisor: Stuart E. Madnick

Title: Associate Professor

TABLE OF CONTENTS

Page

I. INTRODUCTION . . . . . . . 4

II. DESIGN CONSIDERATIONS . . . . 10

III. USER MANUAL . . . . . . . . - 23

A. Introduction . . . . . . . . . 23

B. Daily Operation . - . - 24

C. Running the Program . . . . . . . 25

D. Data Base Set-Up - - - - - - 25

E. Student Input . . - - - - . . - 30

F. Student Input Error Messages - 31

G. User Commands .. . . 33

H. User Error Messages - - - - - 36

IV. STUDENT HANDOUT - - - - - - - - 39

A. Student Input - - - - - - - - 39

B. Student Input Error Messages - - - - - 40

C. Daily Operation - - - - - - - 42

V. PROGRAM REFERENCES - - - - - 43

A. Flow of Jobs . . . . . . . - - 43

B. Functions Performed Main Modules . . . 44

C. File Structure - - - - - - 46

D. Cross References . . . . . . . 49

E. Command Files - - - - - - - 53

VI. APPENDIX - FORTRAN CODE . . . . 61

I. INTRODUCTION

The courses of the Management Information Systems are con-

cerned with computer programming and computer systems. The classes

are organized in a lecture, recitation format with the professors

conducting the lectures and the teaching assistants handling the recitations.

The requirements of the students include exams, problem sets, and

machine problems. The purpose of the machine problems is to give

each student practical experience in the area that is being investigated in

the course material. Each course has several machine problems with

the current maximum for any one course being six. The computer

languages used for these courses include IBM 360/370 assembler, PL/C,

PL/1, and SIM 360, with most courses using more than one of these

languages.

Currently the system for the Management Information Systems

courses at the East Campus Computer Facility is the following. The

East Campus Computer Facility has a Prime system that runs Prime

RJE/2780, which is a communications emulator. It emulates the

IBM 2780 Remote Job Entry terminal, when viewed from the IBM main-

frame system. The Prime emulator provides all the same functions as

the IBM 2780 system, though the mechanics of its operation are different.

All data sent to the IBM mainframe system is from disk files, and all

data received from the IBM mainframe is written into disk files. Using

RJE/2780, both disk-resident files and punched or card decks may be

transmitted with up to 64 jobs queued concurrently for transmission.

When jobs need to be printed they are entered into the print queue on disk,

and spooled from the disk to the printer on a first in, first out basis.

5

Also on the system will be the Prime HASP communications program that

is more advanced than the RJE /2780.

The control of job processing is done interactively by user-written

programs or command files, not a special job control language. The

current program for the card reader that is on the system decides if the

card file is to be (1) sent to the Prime file system, (2) sent to the printer,

or (3) sent to the IBM 370 via the RJE/2780 program. The IBM main-

frame system that the Prime RJE/2780 program sends its programs to is

the MIT Information Processing Center that currently runs the VM 370

operating system. All machine problems will be sent to the Information

Processing Center, and the :Phantom TA program will be able to use

either the RJE/2780 or the HASP program.

The handling of the machine problems is done by the course

teaching assistants. The machine problems are done by batch processing

of card deck input. Support programs for the machine problems have

been written and most machine problems have either a grader, which does

the I/O handling, error handling, provides test data, and grades the

student; or a monitor, which provides error recovery and batching of

compilation of PL /1 programs. The cost overhead incurred for job set-

up and setting up the grader/monitor is much greater than the cost of an

individual student job. This is the reason that student jobs are currently

run under a batch system. The students submit their card deck to be

run during the day and the teaching assistant batches the jobs together to

be run, usually at the end of the day. This involves putting the correct

JCL cards for that machine problem, along with the batch of student jobs.

Sometimes on busy days near due dates, extra batch runs are made during

the day.

This current method of handling the machine problems has certain

inherent problems. First, it requires the teaching assistant's time to

set up the batch properly and run it. Second, caused by the first

problem, the running of the jobs depends more on the teaching assistant's

time schedule than upon the demand for runs. Often a run during the

day would be economical and would give the student feedback before the

next day. Currently the student often gets a run back the following

morning, so they must debug it during the following day, to be able to

re-submit it for the next day's run. If the student has a busy schedule,

he (she) often won't be able to submit a debugged job in time, limiting

him (her) to one run every two days. Third, scanning the student decks

for errors is hard to do. Commonly the teaching assistants will miss a

/* in the first column of a student's program which causes the entire

batch to abort, or they may miss whether each individual job has the

proper end-of-job card. Lastly, because students' decks must be left

in a drawer to be submitted, there are complaints of decks being lost,

and there is the possibility of students copying other students' decks.

To alleviate these problems the Phantom Teaching Assistant

(Phantom TA) program was written. The program is written in Prime

Fortran and is continuously running monitor of card decks that have been

input into a specific file on the Prime System at the East Campus

Computer Facility. The purposes of the Phantom TA program are to

free the teaching assistants from running the jobs, eliminate human

error in the batching of jobs, increase student convenience, and provide

immediate error feedback for certain errors. It will do this by

performing the following functions. One, the program will allow the

student to read in a properly formatted deck to the card reader and the

card deck will not need to be left in a drawer. After input, the student

will either receive an error message, a warning message, or confirma-

tion that the job has been correctly input. Two, the program will

periodically check the number of jobs submitted for each machine

problem to see if enough have been submitted to send a batch to the

Information Processing Center. The parameter for this test will be

easily changeable by the teaching assistants for flexibility. Three, it

will make a run of all jobs submitted at 12 noon and 6 p. m. This will

make sure that each job submitted will get at least one run per day.

Four, it will preprocess the students' input for use of the control

delimiter in the first column, and check to see that each student job has

an end-of-job card at the end of the deck. If the control delimiter is

used, that card will be shifted two columns, and if the end-of-job card is

left off, the program will append another to the end of the student's deck.

In both of these cases, a warning is given to the student. Five, it will

make the correct batch run by appending the appropriate JCL information

to the file containing the student jobs and submitting it in the correct

format to the VM 370. Lastly, while performing the above functions,

the program will keep track of the number of runs per student per

machine problem and be able to limit the number of runs by each student.

Along with these, facilities have been written to allow the teaching

assistants to have control of the operation of the program by a means

similar to that of student input.

To perform the above functions in the current situation, the following

goals were set for the program. First, the program should be flexible

enough for input from both card decks and files. This was important

because of the possibility of the change in the near future to batch

processing and an interactive editor. If the program could only accept

card input, it would be made obsolete by such a change. Second, to

make the program function, a minimum of changes should be made to

other programs on the system to limit complications and problems.

Third, though it is more convenient, the program should not significantly

increase the costs of running the students' jobs. Fourth, the program

should be flexible to the number of courses, the number of machine

problems per course, and the number of teaching assistants. This is

to make the program easily usable from term to term although the

Management Information Systems courses may change. Fifth, the user

commands for the teaching assistants are enough to oversee the running

of the program without a knowledge of the Prime System or the Phantom

TA program code. This would be for cases when not all of the teaching

assistants are familiar with the Prime system. Sixth, the program

should keep a daily log of its activity so that a measure of its effective-

ness can be kept and allow future modifications to the parameters to be

based on the empirical results of actual usage, not someone's feel of

what the usage is. The last goal of the program is to have the document-

ation at a high enough level to allow the program to be maintained by

someone other than the person who originally wrote it. This is

important since the person who maintains the program will be continually

changing. The final program fulfills all of these goals at least to some

extent. The program is flexible to both card deck and file input, needs

no change in another program on the system, is flexible to normal

changes from term to term, logs the daily activities, and allows enough

changes to be made by the user commands that knowledge of the program

code is not necessary. Also, although costs as it is currently running

may be too high, methods to limit this are built in. In the area of

documentation the level is high, but probably not really high enough.

The cause of this was the number of changes that needed to be made to

the program during debugging.

The sections following will deal with the design considerations,

a user manual, a student handout, and program references. The design

considerations section is meant to explain the basic design decisions

and tradeoffs that were made in writing the program. The user manual

is to explain the operation of the program and the user commands to

control it for those who will be overseeing it. In this case, it would be

the teaching assistants who are overseeing it. The student handout is

for distribution to the students of the Management Information System

courses to give an explanation of the use of the program for student job

input. The program references are a collection of information to assist

those who will be doing maintenance on the program software. At the

end of this thesis is an appendix containing the Fortran code of the

Phantom TA program.

II. DESIGN CONSIDERATIONS

The major influence on the design of this program was the soft-

ware limitations of the current system. The Prime system does allow

certain file manipulation routines, and real-time programming routines,

to be called directly from a Fortran program. But the commands

currently available from Fortran do not include those to copy one file to

another spool a file for printing, or the Hasp commands to send a job to

the IBM system. To be able to use these commands, a Fortran program

must call a system routine that executes a command file which contains

the commands. After a command file is executed from a Fortran

program, when control is returned to the program that executes it the

program is reinitialized. This, combined with the fact that this program

to be very useful must use these commands that can only be called by

command files several times a day, makes the use of files necessary to

store much of the program data. This data includes number of jobs

input for each machine problem, and the hour of the last hourly report,

both of which must be saved each day, and it also includes data that

must be saved over the course of the term like student names, number

of runs input per student for each machine problem, the limit for

number of runs for each machine problem, the number of jobs needed

for a batch run for each machine problem, the teaching assistant names,

and the teaching assistant passwords. Having this data stored in files

also allowed the data base to be set up by calling separate, interactive

program that sets up the data files so that most run parameters can be

set without editing the program text and recompiling the code.

A major design consideration for this program was to decide how

the program should be invoked. There were three basic possibilities:

(1) To be called directly from the Card Reader Program, or to actually

be part of the Card Reader program. (2) To be called whenever a file

is input into a certain user file directory (Interrupt Driven). (3) To be

called periodically at regular intervals to check to see if any file has

been input into a certain user file directory. Each method of involving

the program had certain advantages and certain disadvantages. The

first method had the advantage that it would be called only when it needed

to be called, so it would use CPU time more efficiently. It would also

be called immediately, so error feedback would be as soon as possible.

It would also be the easiest to code, since no routines to get the file

from the input user file directory would need to be written, and the

student file could be appended directly to the correct job file instead of

being put in to a file in a particular input user file directory, then being

appended to the correct job file, and the original file deleted. Although

this method would seem to be the most advantageous, it has one drawback.

It would not be easily adaptable to file input. This is one of the major

goals of the program, since if the input method is changed from card

decks to another method, most of the program would need to be

rewritten or else an entire new program written.

The second possible method, to invoke the program when a

student file is input into a certain user file directory, would solve the

major problem of the first method. It would allow both a card deck

method of input, by having the card deck image be put in a specific user

file directory, and allow strictly file input also. This method looked

possible, and would have several advantages that the first method had.

It would be called only when needed, and would provide immediate error

feedback. However, the coding of this alternative would cause a few

problems. For a monitor of the user file directory to start the

execution of the phantom TA program, it would need to know the absolute

location of where the program is located in memory. This location

would be different each time the program was loaded into memory for

execution. The user who loaded the program would have to input this

location to the program. With the possibility of human error in this

input, this looked like an unwanted complication. But this method of

operation seemed to be what would be best. The Print Spooling Program

was investigated to see how it was invoked, because it had the desirable

qualities of an Interrupt Driven Program.

This investigation led to the third possible method of invoking the

Phantom TA program. The Print Spooling Program used a method of

periodic checking for input into a specific UFD at short intervals.

Although it was not interrupt driven, it did not monopolize the CPU time

on the system and it provided close to immediate action. Also, the

system has available the sam.e real-time subroutines that are used by the

Print Spooling Program.

Weighing the three alternatives, the third method was chosen for

this program with slight modifications of the Print Spooler's operation.

The first modification was to have the program called at one-minute

intervals instead of one-second intervals. It was decided that this

change would cause only slight inconvenience to a user and lessen the

amount of CPU time used. The second modification was to only have

the program running during a set time period each day. This is done

by adding a 'wait for' command to the end of the program's command file

when the last batch run of the day is made. The 'wait for' command

causes the program to stop execution until a specified time. In this

program, the time is set at 9:00 a. m. so the program waits from the

last run to 9:00 a. m. the next day.

Several other considerations were made in the design of the

Phantom TA program. One consideration was the security of the system.

Although this was not of the highest priority for the design, it should

have a greater security than is currently available with card deck input.

This was basically accomplished by use of the available system capabil-

ities, with a small amount of additional security checking by the Phantom

TA program. First, the system is divided into three separate user file

directories, each with its own password. One contains the Phantom TA

program, the program documentation, and the information files that are

accessed by the program. The information files should not have

general access since they contain such information as number of runs

allowed for a machine problem, the number of runs by each student, and

the teaching assistants' passwords. The other two user file directories

are used for the input to the program. Both of these directories are set

up so that they can have files placed into them by the Card Reader

Program and they can be attached to as an owner by the Phantom TA

program, but neither of these directories can be logged into from a

terminal. The first of these directories is used for student input, and

the second is used for teaching assistant input. By separating the two

types of input into distinct user directories, it accomplishes added

security by simply using the available resources. If this was not done,

the teaching assistants' input would have to be of a format that could be

recognized by the program, and the security would be that this format

is known only to the privileged users. Also, as the program is

currently running, the students use the student input directory password

as part of the deck input information, so if they were to log onto the

system in another directory, they could attach to the student input

directory, but they would not know the teaching assistant's directory name

or its password. With only access to the student input directory, the

damage that could be done would be comparable to what can now happen

with the card deck input placed in drawers for input. An input file

could be copied, deleted, or altered, but even in these cases the student

still has the original deck. If this situation does not prove satisfactory,

there is the possibility of changing the card reader program so that

instead of using the password, something identifying this as a student

deck is used, then having the Card Reader Program handle the password.

This was not done since it would involve the changing of the Card Reader

Program, and the added security did not seem worth the trouble

involved. Once a deck is input to the teaching assistant's input directory,

the program first checks the name used to see if it is a valid name. If

so, it then checks to see if the course and password input match those

that are associated with that name. Unless all this information is

correct, the file is deleted and an error message is printed on the system

console. Even if name, password, and course were correct, to execute

a TA command the correct format would need to be known. For the

student input decks, there is no facility for this password checking,

although a check is done to see if the student name input is one of those

possible for that course. If a password for the student input becomes

needed, this could be done by having some sort of password appended to

the end of the student's name. This does have its drawbacks though,

since it was not designed with this in mind. One, there is a limit of 16

characters for a student's name, so the name and password combined

could not be greater than 16 characters, and two, a copy of the informa-

tion files is printed at the end of the day, which includes the student

names and would, therefore, include the students' passwords. Besides

these security features, the amount of time that a file spends in either

of the two input directories is small, and the total number of files is

small because of frequent checks for input. In summary, the security

features are not sophisticated, but should be more than adequate for this

situation. If security is broken, the possible damage is small. And

lastly, it is accomplished with low overhead by using the system

capabilities.

A second design consideration was how the files for the storage

of the program data should be formatted and accessed. The size of the

files was not taken to be a major factor, because the size of the data

base is small and any savings in memory used would be insignificant.

The major factors weighed concerning the file formats were ease of

access for information retrieval, ease of printing the information and

capability for updating the information. Also considered was the ease

of setting up these files. One approach would be to have one routine

that stores the state of the program and the data bases and another that

restores this state. The save state routine would be called just before

the program has to go to sleep, then the restore state routine would be

called when the program wakes up. This would have the advantage that

the fact that the information is stored in separate files, instead of as

part of the program, can be made transparent to the program and any

packing to save space could be localized to one routine. This approach

was not used because of three disadvantages. The first disadvantage is

that these routines would have to be called every time the program runs.

This would be okay for most programs, but a large majority of times

this program is called there will be no files to process, so having a save

and restore done every call is not efficient. The second disadvantage

would be that large amounts of data would need to be passed to and from

the save and restore routines. This could have been efficiently done by

the use of 'common' statements to achieve this, but then much informa-

tion would be implicitly passed to routines instead of being directly

passed by use of parameters. This would make the program less clear

to a programmer and harder to maintain. The third disadvantage would

be the inflexibility of this method to changing size of the files that need

to be saved and restored. If all manipulations of files were done by a

program, this would be fine since it could keep track of all additions.

However, adding the facilities to make these changes would be very

involved and still would not assure that some other kind of change would

be needed.

Instead of the above approach, an approach with the following

characteristics was used. The first characteristic is that the files are

stored in a readable format. All information stored, including the

numerical information, is stored as ASC11 characters. This allows the

teaching assistant, or other users, to quickly and easily examine the

data base without having to decode some packing scheme. This also

saves the problem of having separate routines to format the information

for printing. For every printing situation, except when printing out the

hourly report, the file is already in the correct format and only needs to

be spooled. To accommodate the possibility of an indeterminate number

of courses, or a possibly changing number of teaching assistants, there

is no set length for a file. They are structured in a line or card

oriented fashion, in that there are seven different types of cards and

certain types, i. e., course information cards, and teaching assistant

information cards can be of a variable number. This combined with

the fact that the files are ASC11 characters, allows all changes that need

to be made to the files able to be easily accomplished by using the

standard editor available on the system. As a note, most variables that

will change often in program use are changeable by using the user

commands available, but there is not a command to add a teaching

assistant or to add a course after set-up. The files are formatted to

allow them to use the same parsing routine that is used on the control

cards. Currently the Phantom TA program is written to accept files

that have been set up using the data base set-up facility which means that

the spacing of each line matters. If the user did not want to use the

set-up facility, he (she) could either make sure he (she) has the correct

spacing, or change the file reading routines to use the same parse that is

used for the control cards. This parse was not used because with the

set-up flexibility the exact location of the information was known and the

use of the parse would have been less efficient. Another advantage of

using the line or card oriented structure was it allowed th read, search,

and append routines to be standardized. All three used a standard

80-character line, then for the write the system subroutines would delete

any following spaces and add a carriage return line feed to the end of the

line, and for the read the system subroutines would reconstruct the

80-character card image.

The way the search routines worked was to look sequentially

through the file until the first part of the line matched the type of card

that was being looked for, then the rest of the card was checked. These

searches were position-dependent in that if the information looked for

was before where the file pointer was positioned before the call was

made, the information would not be found. Because of this, if separate

access routine were to be invoked to retrieve each piece of information

wanted in a given file, this would be wasteful since each routine would

have to begin at the start of the file, then search sequentially through it.

So, instead of having separate search routines for each item, they have

been divided into larger routines according to what modules need the

information and what files need to be searched. The way this works out,

there are four separate search routines. The first is used by the module

handling student input to search the general information file; the second

is used by the same module to search the particular courses information

file; the third is used by the same module to search the general informa-

tion file. These three searches are dependent upon each other in that if

the information retrieved from the one search is not consistent with the

control card of the student input, the other searches may not be done.

An example of this is that when an incorrect course is specified, the

course file cannot be searched to see if the student's name is valid for

that course. A fourth search routine searches the general information

file for information that is used by the teaching assistant input module.

Although, with this scheme, sometimes it is inefficient since more than

one piece of information that would be needed is returned, the overhead

of doing this is small.

A major effect of the chosen file usage was that it allowed for

each module to run independently of the rest of the modules of the system.

This was done by having an event that changed the running of the program,

i. e., a student inputting a job, cause a change in the data files. So

there is little dependency on one module passing information to another.

The only information that is passed between modules is time information

and whether a command has been added to the programs command file.

This means that modules are driven by the state of the data files. This

simplifies the maintenance of the program since each module can be

almost treated as a separate entity. Also, it lessens the amount of

damage that can occur from the system dying, while the program is

running. It would basically only affect the updates of one module, not

the whole program, and normally is written to affect the user least.

For example, if the system stopped while handling an input, the data

base may be updated but the file not deleted, so the file will be re-input

when the system starts again.

A third design consideration was what coding disciplines should

be used to add to the reliability and maintainability of the Fortran code.

At the highest level, the program was divided into four basic modules, a

control module, a student input module, a teaching assistant's input

module, and a decide batch run module. At this level, approximately

90-95% of the functionality of the program can be seen. To change a

feature of the program, this should be where most of the changes need

to be made. For example, to change when jobs are run it would be at

this level, but to change how a job is run involves changing something at

a lower level. At the second highest level are routines that perform

a functional activity such as make a batch run. As an example, there

are routines to handle the user commands with each routine handling

the execution of one to three command types. All these routines are

called by the four main system modules. At the next level are utilities

for use by the program. These would include file search routines and

a command line parse. These are specific to this program and are used

throughout the program. At the lowest level are subroutines that were

written to make the use of the available Prime system subroutines that

were most often used easier and more understandable. Often these

would be to make a simpler, one purpose routine from one of Prime's

routines that was all-purpose and required several parameters to be

specified. Most of these subroutines were to do the file handling for

the program. Overall, this general pattern of having these four levels

of coding was followed, but because of the small size of the total program

this structure was not strictly adhered to. So that if something was only

to be done a few times, a separate routine would not be written to

perform the function, but the code for it would be expanded in-line at the

places it would be called. This means that each level routines call

routines on all lower levels. The control module is the only routine

that calls routines at its own level. For the top-level modules, the

functional documentation was left from the text of the code and instead

placed separately in the program references. This was done because of

their length and their closeness to the user's manual description. For

all other routines, a functional description of the routine was given at the

start of that given code. This was given to the level that a programmer

should be able to use the routine without having to inspect the code in it.

The programmer would hopefully only need to investigate the routine

that needs to be changed. Besides this functional description, an effort

was made to limit the size of these routines to one printed page, to

increase readability and limit their complexity. A large majority are

one page or under, but a few were expanded to larger size when adding

more capabilities after the original design. Also to increase readability

of the code, all comments interspersed in the code were placed directly

before the code they applied to, and all go to statements that were not

to code a few lines away have been labeled.

A last design consideration was how certain program functions

should be carried out as features of the final program. A main decision

made was that the basic operation of the program was to run batches on

a demand basis during the day, then make a run of all jobs submitted at

the end of the day. The limiting factor on students' jobs was to be the

number of runs they had made for the machine problem. This was to

increase the convenience for the student, so the stopping of job runs

would not be some arbitrary date. Adding to this after a discussion with

the current head teaching assistant was a run at 12 noon along with the

run at 6:oo p. m. To limit the number of batches sent with a small

number of jobs, no jobs are batched from 11 a. m. to 12 noon, nor from

4 p. m. to 6 p. m. So the current operation of the program is a combina-

tion of running at certain times and running on demand. The operation

of the program is flexible based upon how the parameters for the jobs are

set. If only running at certain times is wanted, this can be accomplished

by setting the batch size limit to 99. Also, if it is decided to limit the

number of jobs per student by a time limit instead of by a number of jobs

limit, this can be accomplished by re-setting the limit on the number of

jobs per student to zero on the time deadline. So the program was

basically written to function one way, but is flexible to allow several

modes or combinations of modes of operation.

Another feature decision was how the program should keep track

of its usage. The way chosen was to log each student input with the

student's name, the job value, and time. It should be noted that the job

value is a unique value associated with each machine problem. Then

for batch runs they are logged with the job value, the time, and the date.

This information was also added to the actual batch sent to the

Information Processing Center as a comment card. This allows the

teaching assistants to match up the jobs input to those returned to the

East Campus Computer Facility. Also, every hour a report is printed

that summarizes the number of jobs currently input for each machine

problem. This can be posted to give the students an idea of when their

job will be run, and this can also be used by the teaching assistants to

check to see if the parameters for the program are set for best

efficiency. At the end of each day the log is also printed, then cleared

for the next day. These extensive facilities for monitoring the program

increase the convenience for the student and allow the teaching assistants

to use the program more efficiently.

III. USER MANUAL

A. Introduction

The machine problems of the Management Information Systems

courses of the Sloan School are currently done by batch processing, and

card deck input. This program will make enhancements to this system

to make student input more convenient. Basically it will do this by

automating most of the machine problem processing functions that are

currently performed by the course teaching assistants. The operation

of the Phantom TA program will be to monitor a file that the students

decks can be input into by the card reader. The student will read a

properly formatted deck into the card reader, from the input file the

program will direct the job to the correct file for that machine problem,

and then the program will periodically check to see if enough jobs have

been input for a batch run. If a machine problem is ready to be run

the program will format the file correctly, then submit it to the

Information Processing Center. This program will free the teaching

assistants from this work and be able to perform these functions more

efficiently.

The Phantom TA program will achieve several specific purposes

along the lines of the main purpose of easing the problems of batch

processing with card input, and make the entire process more efficient.

This program will free the teaching assistants for the Management

Information Systems courses from the daily task of manually batching

together student decks and adding the correct JCL information, a

procedure that is inconvenient and subject to human error. The program

will allow the scheduling of batch jobs to fit the student demand and not

the TA's daily schedule. This will make more probable the possibility

of more than one batch run per day for each machine problem. The

program will give the student feedback quickly so that improperly set up

decks can be corrected as soon as possible to help avoid missing a batch

run. Lastly, having this Phantom TA program running will also solve

the problems of students losing their decks that have been left for input

and of students copying other students' decks.

The program itself will be running on the Prime 400 System at

the East Campus Computer Facility. It will seem to the user to be

interrupt driven, but will in actuality be called periodically at short

intervals. This is much the same as the current print spooler program

on the system. The input to the program will be from a specified file

which student card decks are copied into. This file input will make this

program flexible to future changes of input medium. The program will

provide (1) extensive error checking capabilities, (2) all current job

handling functions with the user having control of modifications, and

(3) will keep run information.

B. Daily Operation

The program has the following basic cycle. From 9 a. m. to

6 p. m. the program is called periodically, approximately every minute.

This should almost seem to the user to be interrupt driven. At most

you are waiting sixty seconds longer than the current print spooler

program. Hourly, from 9 a. m. to 6 p.m., a summary of the number of

inputs is printed to give students an idea of the chances they will get a

run during the day, or if the batch with their job has been sent to the IPC

but the output has not returned yet. From 11 a. m. to 12 noon, and from

4 p. m. to 6 p. m. the program is running but no batch runs are made.

This is because every batch will be run at 12 noon and 6 p. m. and you

don't want to send a batch of, say, 15 jobs at 5:30 p.m., then another at

one job at 6 p. m. Then at 6 p.m. all student jobs are run, a log of the

day's inputs and runs is printed, and a summary of the student informa-

tion is printed. The purpose of the log is to see how well the

parameters of the program are functioning so that run limits may be

changed or the time when batch runs are stopped can be changed.

C. Running the Program

To compile all the Fortran code, execute the following command

at Primos command level:

COMINP C PHTA

To load the compiled code, execute the following command at

Primos command level:

COMINP RUNPHTA

To start the Phantom TA program running as a phantom, execute

the following command at Primos command level:

PHANTOM #PH TA

This command starts the program running as a phantom, meaning that

it runs on the system without being logged into a specific terminal. To

stop this program, execute the following command at Primos command

level:

LOGOUT -uu

where uu = the number of the Phantom user as reported by the Phantom

command when it was invoked.

D. Data Base Set-Up

An interactive Fortran routine has been written to assist in

setting up the data base for the Phantom TA program. It clears the

subufd, A1DENKER>CRSFIL, and creates in properly formatted form

the files used by the Phantom TA program. To compile the Fortran

code for this program, execute the following command at Primos

command level:

COMINP CSET

To load the compiled code for this program, execute the following

command at Primos command level:

COMINP RUNSET

To execute the program, execute the following command at

Primos command level:

SEG #SET

It will print what information it wants and wait for the input and a

carriage return. The following is a list of the information asked for:

(1) NUMBER OF COURSES TO SET UP

(2) COURSE NAME (Limit 6 Characters)

(3) MP ## BATCH SIZE

(4) MP ## LIMIT

The maximum number of runs allowed.

(5) MP ## JCLFILE (Limit 10 Characters)

(3-5 are asked for each machine problem.)

(6) STUDENT NAME (Limit 16 Characters)

This will be repeated until only a period and a

carriage return are typed.

(7) DELIMITER (2 characters)

(8) TA NAME (Limit 16 Characters)

(9) COURSE

The TA's course.

27

(10) PASSWORD (Limit 6 Characters)

8, 9, 10 will be repeated until a period and

carriage return are input for the TA name.

An example section follows.

COMINP C SETC>/* A1DENKR>C SETC>/* THIS COMPILES DATA BASE SET-UPC>FTN F SET UP -64V -DCLVAR0000 ERR~ORS ~(. M AIN. )FTN-REV16. X]C>FTN F ATTACH -64V -DCLVAR0000 ERRORS [(ATTACH)FTN-REV16.X]C>FTN F ICONV -64V -DCLVAR0000 ERR~ORS [(ICONV)FTN-REV16.X]C>FTN F NEWJCL -64V -DCLVAR0000 ERRORS [(NEWJCL)FTN-REV16.X]C->FTN F BANNER -64V -DCLVAR0000 ERRDRS [(BANNER)FTN-REV16.X]C>FTN F APPEND -64V -DCLVAR0000 ERR~ORS [(APPEND)FTN-REV16.X]C>FTN F GETFIL -64V -DCLVAR0000 ERRTRS [(GETFIL)FTN-REV16.X]C>END OF FILE. COMINP FILEC>COMINP RUN SETC>/* A1DENKER>RUN SETC>/* THIS LOADS THE DATA BASE SET UC>FILMEM ALLC>SEG# VLOAD #SET$ LOAD B F SET UP$ LOAD B~F ATT ACH$ LOAD B~F~GETFIL$ LOAD B~F~ICONV$ LOAD B~F~NEWJCL$ LOAD B F~BANNER$ LOAD B F~APPEND$ LIBRART -

$ LIBRARY VAPPLB$ LIBRARY SFTNLB$ LIBRARY IFTNLB17LOAD COMPLETE$ SAVE #SET$ QUITC>END OF FILE. COMINP FILEC>SEG #SETNUMBER OF COURSES TO SET-UP: 2COURSE NAME: 15.561NUMBER MACHINE PROBLEMS: 2MPO1 BATCH SIZE: 10MP01 LIMIT: 20MP01 JCL FILE: TEST JCLMP02 BATCH SIZE: 10MP02 LIMIT: 20MP02 JCL FILE: TEST JCLSTUDENT NAME: CARTERSTUDENT NAME: FORDSTUDENT NAME: NIXONSTUDENT NAME: JOHNSONSTUDENT NAME:

PROGRAM

P PROGRAM INTO #SET

COURSE NAME: 15. 564NUMBER MACHINE PROBLEMS: 2MP01 BATCH SIZE: 15MP01 LIMIT: 25MPO1 JCL FILE: 15ILLEGAL NAME. (RNAM$A)MP01 JCL FILE: TEST JCLMP02 BATCH SIZE: 16~MP02 LIMIT: 26MP02 JCL FILE: TEST JCLSTUDENT NAME: RINDERLESTUDENT NAME: KULS@ASONSTUDENT NAME: GLASSMANSTUDENT NAME: PEACOSTUDENT NAME: DELFELDSTUDENT NAME: CURTISSTUDENT NAME:.DELIMITER: ??TA NAME: DENKERCOURSE: 15.561PASSWORD: THESISTA NAME: KRAKAUERCOURSE: 15. 564PASSWORD: HEADTATA NAME: .C>COPY A1DENKER:NTRUMP>TEST JCLC>COPY A1DENKER:NTRUMP>TEST JCLC>COPY A1DENKER:NTRUMP>TEST~JCLC>COPY A1DENKER:NTRUMP>TEST~JCLC>CO TTYC>A CRSFIL 1 2C>TYPE INFO

CRSNM=REP=10CRS=15.CRS= 15.JOB=01JOB=02JOB=03JOB=04DELIM=TANAM=TANAM=

02

561 MPNUM=02 JOBST=01 C564 MPNUM=02 JOBST=03 C

BATCH=10 INPUT=00BATCH= 10 INPUT=00BATCH=15 INPUT=00BATCH=16 INPUT=00

DENKER CRS=15. 561KRAKAUER CRS= 15. 564

C>TYPE CRSN01

COURSE: 15. 561LIMITS:CARTERFORDJOHNSONNIXON

MP1=20MP1= 00MP1=00MP1=00MP1=00

A 1DENKER:NTRUMP>CRSFIL>JCLP0 1A 1DENKER:NTRUMP>CRSFIL>JCLP02A 1DENKER:NTRUMP>CRSFIL>JCLP03A1DENKER:NTRUMP>CRSFIL>JCLP04

RSVL=01RSVL=02

PASSW=T HESISPASSW=HEADTA

MP2=20MP2=00MP2=00MP2=00MP2=00

E. Student Input

The input of a student job is handled by inputting to the card

reader a card deck of proper format. The student's card deck should

be formatted the following way. The first card is for the card input

program. It specifies the file that this job should be input into. It has

the following format:

$$ UFD=INFIL, FILE= (STUDENT NAME), PASSWD=MISCRS

If the deck is input into the wrong file, the Phantom TA program will

never see it. So it will not be run, and no error messages will be

printed, unless the deck violates some card input specifications. The

second card of the student's deck is for the Phantom TA program. It

specifies the student's (1) course, and (2) machine problem. This will

be used by the program to direct the handling of the student file. It has

the following format:

** CRS=(COURSE), MP= (MACHINE PROBLEM)

Errors in the format of this card will be detected. However, there are

errors that cannot be detected. For example, if a possible, but wrong,

machine problem is specified. Of course, this is comparable to a

student placing his (her) deck into the wrong drawer for input. All error

messages for card input will be output on the command console of the

East Compus Computer Facility. After these two cards the student

places his (her) job in normally formatted form. Then as the last card

in his (her) deck he (she) places the end-of-file card which tells the card

reader that this is the final card of this deck. It has the following format:

$$ END

Do not input two decks with the same student name simultaneously. Wait

for the first to be successfully input before inputting the second deck.

Once a job is correctly input a message similar to the following will be

output:

STUDENT JOB INPUT

STD=(STUDENT NAME) CRS=(COURSE) MP=(MP)

IT IS 08/11 OF JOBS NEEDED FOR THIS RUN

F. Student Input Error Messages

The following are the error messages for improper decks that

will be output to the command console. Each will be prefaced by the

following:

STUDENT DECK INPUT ERROR *

For all errors the deck will not be input, the job input card will be

printed, and an error message will be printed.

(1) BAD KEYWORD

Either 'CRS' or 'MP' have been spelled wrong on the job

input card.

(2) REPEATED KEYWORD

The same keyword has been used more than once on the

job input card.

(3) NO COURSE IDENTIFIED

The program has not been able to find a course name.

Either there is no 'CRS=' on the job input card, or the

card is blank after the 'CRS='.

(4) NO MACHINE PROBLEM IDENTIFIED

The program has not been able to find a machine problem

number. Either there is no 'MP=' on the job input card,

or the card is blank after 'MP='.

(5) INVALID COURSE

The job input card is the correct format, but the course

identified is not among those possible.

(6) INVALID MACHINE PROBLEM

The job input card is the correct format, but the machine

problem identified is not among those possible.

(7) NAME NOT REGISTERED

The name input is not among those that are supposedly

registered for the course identified. This will not be

checked unless a proper course is identified.

(8) OVER RUN LIMIT

The student has used all his (her) allotted runs and attempts

to make one more. If the TAs have input any waivers, they

will be checked before this error is checked for.

(9) NO JOB INPUT CARD

The second card of the student's deck is not a job input card.

The following warnings will be output to the command console.

Each warning will be prefaced by the following:

STUDENT DECK WARNING

For all warnings the deck will be input, and a warning message

printed.

(1) NAME TOO LONG

The student name input is longer than 16 characters. It will

be truncated to 16 characters.

(2) CONTROL DELIMITER USED

The delimiter used by the JCL program to tell where the end

of the student jobs is, has been used in a student program.

The current delimiter is "?? " in the first column. The card

with the delimiter will be shifted, so that that card will not be

misinterpreted by the JCL program. The deck will be input,

a warning message "control delimiter used, "??" in the first

column", and the specific card will be printed.

(3) NO END-OF-JOB CARD

The final card of the student's file is not an end-of-job card

which is used to separate student jobs. An end-of-job card

will be appended to the student file and a warning message

''end-of-job card appended to the end of student deck" will be

printed.

G. User Commands

The user commands are to allow the users more control over the

operation of the program and gives them the ability to easily make small

changes to the data base. These commands can be input by two different

methods. First, it is possible to use card deck input. The first card

of the deck is for the card reader program. It specifies the file that

the job should be input into. It has the following format:

$$ UFD=TAINP, FILE= (TANAME), PASSWD=TA PASS

The second card of the deck is for the Phantom TA program. It

specifies the user's (1) course, and (2) password. It has the following

form:** CRS=(COURSE), PASSW= (PASSWORD)

After this card, any number of the user commands can follow with a

"$$ end" card placed afterwards to end the file. Second, it is possible

to attach to the TAINP ufd from a user terminal and create these files

with the editor. With this kind of input, only the course and password

card is needed as the first line in the file. The program will period-

ically check for user input from 9 a. m. to 6 p. m.

The user commands are:

(1) ADD STUDENT

This is used to add a student's name to the data base. The

name will be added to the course specified by the TA input

card in alphabetical order. The form of the command is:

ADD STD=(STUDENT NAME)

where (STUDENT)= the student's name.

If this name is not unique for this course, then a digit will be

appended only to the new name, and a warning will be printed

on the command console.

(2) DELETE STUDENT

This command is used to delete a student from the data base.

It is deleted from the course specified on the TA input card.

The form of the command is:

DELETE STD=(STUDENTNAME)

If the name given is not found in the specified course, no

deletion will occur, and a warning message will be output on

the command console.

(3) WAIVER OF JOB LIMIT

This is used to allow an individual student a specified number

of extra runs for a specific machine problem. The form of the command

is: WAIVER STD= (STUDENT), MP= MP), NUM= (+/ -#)

where (MP) = the machine problem number;

K+/- #) = a signed number, the number of extra

or less runs allowed.

If the name given cannot be found in the specified course, a

warning will be output on the command console.

(4) CHANGE RUN LIMIT FOR MACHINE PROBLEM

The command is to change the number of runs allowed for a

certain machine problem for the entire class. The form of

the command is:

CHANGE MP=(MP), NUM=K+/-#)

(5) PRINT INFORMATION

These commands are used to print out the information stored

by the program. There are three separate commands: one

to print the daily log, and another two to print the student

information available. The form of the first is:

PRINTLOG

The form of the second is:

PRINTINFO

This command will print all info for the course that is

specified in the TA input card. The form of the third is:

PRINTALL

This command will print the student information for all the

courses in the program. At 6 p. m. each day the printlog and

printall commands are automatically called.

(6) MAKE MACHINE PROBLEM RUN

This command is used to force the program to run a certain

machine problem, even though the run limit has not been

reached. The form of the command is:

RUN MP=(MP)

If the user wants to run all machine problems for the course

specified in the TA input card, he (she) can by using the

following command:

RUNCRS

If the user wants to run all the machine problems for the

courses he (she) can by using the following command:

RUNALL

(7) RESET BATCH LIMIT FOR MACHINE PROBLEM

This command is used to reset the number of jobs needed before

a batch run is made. The form of the command is:

RESET MP=(MP), NUM=(#)

where #) = the new number of jobs needed before a batch

run is made. (unsigned)

(8) CHANGE THE JCL FILE FOR A CERTAIN MACHINE PROBLEM

This command is used to replace the currently used JCL file

for a certain machine problem with another file. The form

of the command is:

JCL MP= (MP), FILE=(FILENAME)

where (FILENAME) = the new JCL information file limited to

10 characters.

H. User Error Messages

The following are the error messages for improper decks that will

be output to the command console. Each will be prefaced by the following:

* USER DECK INPUT ERROR *

For all errors the deck will not be input, the job input card will be

printed, except for the error bad command input, where the command

will be skipped, and the rest of the deck processed.

(1) BAD KEYWORD

Either 'CRS or 'MP' have been spelled wrong on the job

input card.

(2) REPEATED KEYWORD

The same keyword has been used more than once on the job

input card.

(3) NO COURSE IDENTIFIED

The program has not been able to find a course name.

Either there is no 'CRS=' on the job input card, or the card

is blank after the 'CRS='.

(4) NO PASSWORD IDENTIFIED

The program has not been able to find a password. Either

there is no 'PASSW=' on the job input card, or the card is

blank after 'PASSW='.

(5) INVALID COURSE

The job input card is the correct format, but the course

identified is not among those possible.

(6) NO RIGHT

An improper name, or password, has been input for a user

deck.

(7) BAD COMMAND INPUT

The program cannot interpret the card as one of the user

commands available. The card is skipped and no side effects

will occur.

38

(8) NO JOB INPUT CARD

The second card of the user's deck is not a job input card.

If the file has been created by the editor, the first line is

not a job input card.

IV. STUDENT HANDOUT

A. Student Input

The input of a student job is handled by inputting to the card

reader a card deck of proper format. The student's card deck should

be formatted the following way. The first card is for the card input

program. It specifies the file that this job should be input into. It has

the following format:

UFD=INFILE, FILE= (STUDENT NAME), PASSWD=MISCRS

If the deck is input into the wrong file, the Phantom TA program will

never see it. So it will not be run, and no error messages will be

printed, unless the deck violates some card input specifications. The

second card of the student's deck is for the Phantom TA program. It

specifies the student's (1) course, and (2) machine problem. This will

be used by the program to direct the handling of the student file. It has

the following format:

CRS= (course), MP=(machine problem)

Errors in the format of this card will be detected. However, there are

errors that cannot be detected, for example, if a possible, but wrong,

machine problem is specified. Of course, this is comparable to a

student placing his (her) deck into the wrong drawer for input. All error

messages for card input will be output on the command console of the

East Campus Computer Facility. After these two cards the student

places his (her) job in normally formatted form. Then as the last card

in his (her) deck he (she) places the end-of-file card which tells the card

reader that this is the final card of this deck. It has the following format:

$$ END

Do not input two decks with the same student name simultaneously.

Wait for the first to be successfully input before inputting the second

deck. Once a job is correctly input, a message similar to the following

will be output:

STUDENT JOB INPUT

STD=(STUDENT NAME) CRS=(COURSE) MP=(MP)

IT IS 8/11 OF JOBS NEEDED FOR THIS RUN

B. Student Input Error Messages

The following are the error messages for improper decks that

will be output to the command console. Each error message will be

prefaced by the following:

STUDENT DECK INPUT ERROR

For all errors the deck will not be input, the job ijput card will be

printed, and an error message will be printed.

(1) BAD KEYWORD

Either 'CRS' or 'MP' have been spelled wrong on the job

input card.

(2) REPEATED KEYWORD

The same keyword has been used more than once on the

job input card.

(3) NO COURSE IDENTIFIED

The program has not been able to find a course name.

Either there is no 'CRS=' on job input card, or the card is

blank after the 'CRS=.

(4) NO MACHINE PROBLEM IDENTIFIED

The program has not been able to find a machine problem

number. Either there is no 'MP=' on the job input card,

or the card is blank after 'MP='.

(5) INVALID COURSE

The job input card is the correct format, but the course

identified is not among those possible.

(6) INVALID MACHINE PROBLEM

The job input card is the correct format, but the machine

problem identified is not among those possible.

(7) NAME NOT REGISTERED

The name input is not among those that are supposedly

registered for the course identified. This will not be

checked unless a proper course is identified.

(8) OVER RUN LIMIT

The student has used all his (her) allotted runs and attempts

to make one more. If the TAs have input any waivers, they

will be checked before this error is checked for.

(9) NO JOB INPUT CARD

The second card of the student's deck is not a job input card.

The following warnings will be output to the command console.

Each warning will be prefaced by the following:

STUDENT DECK WARNING

For all warnings the deck will be input, and a warning message printed.

(1) NAME TOO LONG

The student name input is longer than 16 characters. It will

be truncated to 16 characters.

(2) CONTROL DELIMITER USED

The delimiter used by the JCL program to tell where the end

of the student jobs is has been used in a student program.

The current delimiter is "?? " in the first column. The

card with the delimiter will be shiftedso that card will not

be misinterpreted by the JCL program.

(3) NO END-OF-JOB CARD

The final card of the student's file is not an end-of-job card

which is used to separate student jobs. An end-of-job card

will be appended to the student file.

C. Daily Operation

The program has the following basic cycle. From 9 a. m. to

6 p.m. the program is called periodically, approximately every minute.

This should almost seem to the user to be interrupt driven. At most

you are waiting sixty seconds longer than the current print spooler

program. Hourly, from 9 a. m. to 6 p.m., a summary of the number of

inputs is printed to give students an idea of the chances they will get a

run during the day, or if the batch with their job has been sent to the IPC,

but the output has not returned yet. From 11 a. m. to 12 noon, and from

4 p. m. to 6 p. m., the program is running but no batch runs are made.

This is because every batch will be run at 12 noon and 6 p.m. and you

don't want to send a batch of, say, 15 jobs at 5: 30 p.m., then another of

one job at 6 p.m.

V. PROGRAM REFERENCES

A. Flow of Jobs

FLOW OF STUDENT JOB

(1) Input to card reader (ECCF).

(2) Card reader (VRDR) program creates file in input UFD.

(3) Phantom TA program, which checks input UFD periodically

for input, processes deck. If OK, the student job will be

appended to a particular job file, then input file is deleted.

If not OK, an error message will be printed on command

console and the student file will be deleted.

(4) Phantom TA program checks data base to see if enough jobs

for a batch run have been input. If yes, then the proper

hasp commands are appended to the command file, and the

command file flag is set.

(5) Phantom TA checks to see if command file flag is set. If

yes, the command file is executed.

(6) Hasp program sends job to IBM VS/1.

(7) Printout is sent back to ECCF.

FLOW OF TA JOB

(1) Input to card reader (ECCF)

(2) Card reader (VRDR) program creates file in TAINP UFD.

(3) Phantom TA program, which periodically checks TAINP UFD

for input, checks to see if name and password are correct.

If OK, processes deck or else deletes file.

(4) Phantom TA program performs operations necessary to

accomplish commands.

(i) Add commands to command file and set

command file flag.

(ii) Make change to data base.

(5) Phantom TA deletes the input file.

(6) Phantom TA checks to see if command file flag is set.

If yes, the command file is executed.

B. Functions Performed Main Modules

PH - TA Module - Control Structure

(1) Clear command file - start.

(2) Delay for one minute - start.

(3) Close all file units - start.

(4) Make end-of-day run (6 p.m.)

(A) Run all jobs (call decide (true)).

(B) Print course files.

(C) Print log.

(D) Add wait for 9 a. m. to command file; set command flag.

(E) Add delete LOGFIL, so log will be reset for next day.

(5) Decides if 12:00 run should be made.

(6) Decides if batch size should be checked from 9-11 a. m, 12-4 p.m.

(7) Makes hourly report (Call HRPORT).

(8) Checks command flag.

(9) Calls command file.

JOBINP - Student Input

(1) Check student control card.

(A) Correct course.

(B) Correct machine problem.

(2) Check if student name matches one in designated course.

(3) Check rest of cards for control delimiter in first column.

If so, shift card.

(4) If first deck input, clear job file.

(5) Append cards to proper job file.

(6) Check if last card is end of job card; if not, append one.

(7) Increment number of jobs input for job.

(8) Increment number of jobs run for that student.

(9) Add student to log (call LOGNAM).

(10) Delete student file.

TAINP - Teaching Assistant's Input

(1) Check control card.

(A) Course.

(B) Password.

(2) Check name.

(3) Process user commands

(4) Delete file.

DECIDE - Decide Batch Runs

(1) Compare number of jobs input and number of jobs needed for

a batch run. For all machine problems, and all courses.

(2) Check to see if run all jobs flag is set.

(3) Checks if zero jobs are input.

(4) Runs jobs (Call RUNJOB).

SET-UP - Set-Up Data Base

(1) Clear AlDENKER - CRSFIL Subufd.

(2) Create and clear all files to be set up.

(3) Ask number of courses to set up.

(4) For each course:

(A) Ask number of machine problems for each machine

problem.

(1) Ask limit.

(2) Ask batch size.

(3) Ask JCL file name.

(B) Ask student names.

(5) Sort student names alphabetically.

(6) Ask delimiter.

(7) Ask Teaching Assistant information.

(A) Name.

(B) Course.

(C) Password.

(8) Set up files with this information.

(9) Set hourly report value to 10.

C. File Structure

File Definitions

INFIL= UFD FOR STUDENT INPUT

TAINP= UFD FOR TA INPUT

A1DENKER>CRSFIL= FILES USED BY THE PHANTOM TA PROGRAM

WHEN IN OPERATION

A1DENKER>CRSFIL>INFO= INFORMATION FILE

A1DENKER>CRSFIL>CRSN##= COURSE INFORMATION FILES

A1DENKER>CRSFIL>JCLP##= JCL FILES FOR THE DIFFERENT

MACHINE PROBLEMS

47

A1DENKER>CRSFIL>JOBN##= FILES THAT CORRECT STUDENT JOBS

ARE APPENDED TO ##= IDENTIFYING NUMBER

File Formats

For the following two files, each type of card is kept contiguously

in the file in the order they are presented:

FILE: A1DENKER>CRSFIL>INFO

(1) NUMBER OF COURSES CARD (1 CARD)

COLUMN

CRSNUM=##

(4)

(2) TIME OF NEXT HOUR REPORT CARD (1 CARD)

COLUMN

REP=##

(3)

(3) COURSE INFORMATION CARD (1 CARD PER COURSE)

COLUMN

1CRS=AAAAAA

(3-5)

13MPNUM=##

(10)

23JOBST=##

(15)

33CRSVA L=##

(21)

(4) DELIMITER CARD (1 CARD)

COLUMN

DELIM=AA(4)

(5) RUN INFORMATION CARD (1 CARD PER JOB)

COLUMN

9BATCH=##

(8)

19INPUT=##

(13)

(6) TA INFORMATION CARD (1 CARD PER TA)

COLUMN

1JOB=##

(3)

TANAM=AAAAAAAAAA(4-11)

CRS=BBBBBB(15-17)

37PASSW=CCCCCC

(22-24)

(7) WAIVER CARD (1 CARD PER WAIVER INPUT)

COLUMN

1STD=AAAAAAAAAA

(3-10)

23CRS=BBBBBB

(14-16)

35MPN=##

(20)

43NUM=####

(24-25)

FILE: A1DENKER>CRSFIL>CRSN##

(1) COURSE NAME CARD (1 CARD)

COLUMN

COURSE: AAAAAA(5-7)

(2) MACHINE PROBLEM LIMITS CARD (1 CARD)

COLUMN

1 19LIMITS: MP1=##

(12)

27MP2=##

(16)

35MP3=##

(20)

43MP4=##

(24)

51MP5=##

(28)

59 67MP6=## MP7=##

(32) (36)

75MP8=##

(40)

(3) STUDENT INFORMATION CARD (1 CARD PER STUDENT)

COLUMN

1AAAAAAAAAA

19MP1=##

(12)

27MP2=##

(16)

35MP3=##

(20)

43 51MP4=## MP5=##

(24) (28)

59MP6=##

(32)

(##) ARRAY VALUE

67MP7=##

(36)75MP8=##

(40)

NOTE: THE NUMBER OF MP'S FOR CARDS 2 AND 3 DEPENDS UPON

NUMBER OF MP'S IN COURSE

ALL NAMES ARE SIXTEEN CHARACTERS, WITH ALL CHARACTERS

CONTIGUOUS WITH ONLY TRAILING SPACES. THE CHARACTERS COMMA ,

EQUAL SIGN, OR A SPACE SHOULD NOT BE USED IN THESE NAMES.

D. Cross References

Routines Called

PH TA(MAIN) - JOBINP, TAINP, DECIDE, HRPORT, ATTACH, ICONV,

READTL, PRINT, APPEND, BANNER,

SLEEPS, TRNC$A, CLOS$A, TIME$A, CNVA$A, COMI$$, ATCH$$

APPEND - PRWF$$

GETFIL - CLOS$A, NLEN$A, TSCN$A, CNAM$$, BANNER

READTL - COMPAR

CHGSTD - SRCH01, BANNER, NMCRMP, ATTACH, APPEND, ICONV,

TNOU, CLOS$A, TRNC$A, RPOS$A, POSN$A, DELE$A, CNAM$$

RESET - SRCH01, ATTACH, COMPAR, ICONV,

CNVA$A, CLOS$A, DELE$A, CNAM$$, TRNC$A

WAIV - ATTACH, APPEND,CLOS$A

CHANGE- SRCH1, ATTACH, READTL, COMPAR, APPEND, ICONV

CNVA$A, CLOS$A, TRNC$A, POSN$A, RPOS$A, DELE$A, CNAM$$

PRINT - ATTACH, APPEND,CLOS$A

NEWJCL- ATTACH, APPEND, ICONV,CLOS$A

RUNJOB - ATTACH, APPEND, COMPAR, ICONV,

CNVA$A, CLOS$A, TRNC$A, POSN$A, RPOS$A, DELE$A, CNAM$$

ATTACH.- ATCH$$, OPEN$A, TNOU, BANNER

SRCHO1 - ATTACH,READTL,PARSE,

CNVA$A, CLOS$A

SRCH02 - ATTACH, READTL, ICONV,

CNVA$A, CLOS$A

SRCH03 - ATTACH, READTL, PARSE, COMPAR,

CNVA$A, CLOS$A

NMWAIV

BANNER

NMCRMP

JOBINP

TANIP

DECIDE

PARSE

COMPAR

CHCKMP

ICONV

HRPORT

LOGNAM

SET UP

- ATTACH, READTL, COMPAR,

CNVA$A, CLOS$A

- TNOU

- TNOU

- BANNER, NMCRMP, PARSE, SRCHO1, SRCH02, NMWAIV, ATTAC

READTL, APPEND, GETFIL, LOGNAM

ATCH$$, OPEN$A, RPOS$A, CLOS$A, TNOU, CNVA$A, POSN$A,

TRNC$A, TNOUA, DELE$A, CNAM$$

- BANNER, PRINT, NMCRMP, PARSE, SRCH01, RUNJOB, SRCH03,

CHGSTD, CHCKMP, SRCH02,WAIV, CHANGE, RESET, NEWJCL,

GETFIL,

ATCH$$, TNOU, OPEN$A, POSN$A, REPS$A, CLOS$A, TNOUA,

NAMEQV, DELE$A

- ATTACH, READTL, PARSE, RUNJOB,

TNOU, CNVA$A, CLOS$A

- BANNER,

TNOU, TNOUA, NAMEQV

- (NONE)

- SRCH@1, BANNER, NMCRMP,

TNOU, CHVA$A

- BANNERTNOU

- ATTACH, APPEND, BANNER, COMPAR, ICONV, PRINT,

READTL, SRCH01,

CLOS$A, CNAM$$, DATE$A, CNVA$A, DELE$A, POSN$A,

RPOS$A, TRNC$A, TNOU

- ATTACH, APPEND, ICONV,

CLOS$A

- ATTACH, ICONV, GETFIL, NEWJCL,

H,

ATCH$$, DELE$A, TRNC$A, CLOS$A, RNUM$A, RNAM$A,

COMI$$

Routines Called By

APPEND

READTL

CHGSTD

RESET

WAIV

CHANGE

PRINT

NEWJCL

RUNJOB

ATTACH

SRCH01

SRCH02

SRCH03

BANNER

NMCRMP

JOBINP

TAINP

DECIDE

- SETUP, PHTA(MAIN), WAIV, PRINT, RUNJOB, JOBINP, NEWJCL,

CHGSTD, CHANGE, HRPORT

- HRPORT, DECIDE, PH TA(MAIN), CHANGE, NMWAIV, SRCH$l,

SRCH02, SRCHO3, JOBINP

- TAINP

- TAINP

- TAINP

- TAINP

- TAINP, PH TA (MAIN), HRPORT

- TAINP,SET UP

- TAINP, DECIDE

- RESET, DECIDE, SET UP, PH TA(MAIN), WAIV, CHANGE, SRCH01,

JOBINP, PRINT, NEWJCL, SRCHO2, CHGSTD, NMWAIV, HRPORT,

SRCH03, RUNJOB, LOGNAM

- RESET, CHANGE, TAINP, JOBINP, CHCKMP, CHGSTD

- TAINP, JOBINP

- TAINP

- TAINP, PARSE, JOBINP, CHCKMP, CHGSTD, GETFIL, HRPORT,

ICONV, ATTACH

- JOBINP, TAINP, CHGSTD, CHCKMP

- PHTA(MAIN)

- PH TA(MAIN)

- PH TA(MAIN), SET UP

PARSE

COMPAR

CHCKMP

ICONV

HRPORT

LOGNAM

POSN$A

PRWF$$

RPOS$A

CNVA$A

CLOS$A

TNOU

SLEEPS

TRNC$A

ATCH$$

TSCN$A

OPEN$A

TNOUA

DELE$A

DATE$A

CNAM$$

- DECIDE, SRCH01, SRCH03, TAINP, JOBINP

- READTL, RESET, CHANGE, RUNJOB, SRCHO3, NMWAIV, HRPORT

- TAINP

- PH TA (MAIN), CHGSTD, RESET, CHANGE, NEWJCL, RUNJOB,

SRCH02, HRPORT, LOGNAM, SETUP

- PHTA(MAIN)

- JOBINP

- CHGSTD, CHANGE, RUNJOB, TAINP, JOBINP, HRPORT

- APPEND

- TAINP, JOBINP, CHGSTD, CHANGE, RUNJOB, HRPORT

- RESET, DECIDE, PH TA(MAIN), CHANGE, NMWAIV, SRCHO1,

SRCH02, RUNJOB, JOBINP, HRPORT, CHCKMP

- RESET, DECIDE, PH TA(MAIN), WAIV, CHANGE, NMWAIV, SRCH1,

SRCH02, SRCH03, GETFIL, PRINT, RUNJOB, TAINP, JOBINP,

HRPORT, SET UP, LOGNAM, NEWJCL, CHGSTD

- DECIDE, SET UP, TAINP, PARSE, JOBINP, CHCKMP, NMCRMP,

BANNER, CHGSTD, ATTACH, HRPORT

- PHTA(MAIN)

- JOBINP, SETUP, PH TA(MAIN), CHGSTD, RESET, CHANGE,

RUNJOB, HRPORT

- TAINP, JOBINP, ATTACH, PH TA(MAIN), SET UP

- GETFIL

- TAINP, JOBINP, ATTACH

- JOBINP, TAINP, PARSE

- CHGSTD, RESET, CHANGE, RUNJOB, JOBINP, HRPORT, SET UP

- RUNJOB,HRPORT

- GETFIL, CHGSTD, RESET, CHANGE, RUNJOB, JOBINP, HRPORT

TIME$A - PH TA(MAIN), LOGNAM

RNUM$A - SETUP

RNAM$A - SETUP

COMI$$ - SET UP, PH TA(MAIN)

NLEN$A - GETFIL

E. Command Files

/* A1DENKER >C PHTA

/* THIS COMPILES ALL THE CODE FOR PHANTOM TA

FTN F PH TA -64V -DCLVAR

FTN F JOBINP -64V -DCLVAR

FTN FTAINP -64V -DCLVAR

FTN FDECIDE -64V -DCLVAR

FTN F-APPEND -64V -DCLVAR

FTN FGETFIL -64V -DCLVAR

FTN FREADTL -64V -DCLVAR

FTN F CHGSTD -64V -DCLVAR

FTN FRESET -64V -DCLVAR

FTN F WAIV -64V -DCLVAR

FTN F CHANGE -64V -DCLVAR

FTN FPRINT -64V -DCLVAR

FTN FNEWJCL -64V -DCLVAR

FTN FRUNJOB. HASP -64V -DCLVAR

FTN F RUNJOB.2780 -64V -DCLVAR

FTN FBANNER -64V -DCLVAR

FTN FNMCRMP -64V -DCLVAR

FTN FSRCH1 -64V -DCLVAR

FTN FSRCH02 -64V -DCLVAR

FTN FSRCH03 -64V -DCLVAR

FTN FNMWAIV -64V -DCLVAR

FTN FPARSE -64V -DCLVAR

FTN FCOMPAR -64V -DCLVAR

FTN FCHCKMP -64V -DCLVAR

FTN FICONV -64V -DCLVAR

FTN F ATTACH -64V -DCLVAR

FTN FHRPORT -64V -DCLVAR

FTN FLOGNAM -64V -DCLVAR

/* A1DENKER >RUN PHTA

/* THIS LOADS THE PHANTOM TA PROGRAM INTO #PHTA

/* TO LOAD 2780 VERSION USE RUN PHTA.2780

FILMEM

SEG

VLOAD #PHTA

LOAD BFPH-TA

LOAD BBJOBINP

LOAD BFTAINP

LOAD BFDECIDE

LOAD BFAPPEND

LOAD BFGETFIL

LOAD BFREADTL

LOAD BFCHGSTD

LOAD BFRESET

LOAD BF WAIV

LOAD B F CHANGE

LOAD BFPRINT

LOAD BFNEWJCL

LOAD BFRUNJOB. HASP

LOAD BFBANNER

LOAD BFNMCRMP

LOAD BFSRCH01

LOAD B F SRCHO2

LOAD BFSRCH03

LOAD BFNMWAIV

LOAD BFPARSE

LOAD BFCOMPAR

LOADBFCHCKMP

LOAD BFICONV

LOAD B F ATTACH

LOAD BFHRPORT

LOAD BFLOGNAM

LIBRARY

LIBRARY VAPPLB

LIBRARY SFTNLB

LIBRARY IFTNLB17

SAVE #PHTA

QUIT

/ A1DENKER >RUNPHTA.2780

/* THIS LOADS THE PHANTOM TA PROGRAM INTO #PHTA

/* TO LOAD HASP VERSION USE RUN PHTA

FILMEM

SEG

VLOAD #PHTA

LOAD B FPHTA

LOAD BFJOBINP

LOAD BFTAINP

LOAD B F DECIDE

LOAD BFAPPEND

LOAD B F GETFIL

LOAD BFREADTL

LOAD BFCHGSTD

LOAD BFRESET

LOAD BF WAIV

LOAD BFCHANGE

LOAD B F PRINT

LOAD BFNEWJCL

LOAD BFRUNJOB. 2780

LOAD BFBANNER

LOAD BFNMCRMP

LOAD BFSRCHO1

LOAD B F SRCH02

LOAD BFSRCH03

LOAD BFNMWAIV

LOAD BFPARSE

LOAD BFCOMPAR

LOAD BFCHCKMP

LOAD BFICONV

LOAD BF ATTACH

LOAD B F HRPORT

LOAD BFLOGNAM

LIBRARY

LIBRARY VAPPLB

LIBRARY SFTNLB

LIBRARY IFTNLB17

SAVE #PHTA

QUIT

/ A1DENKER >C-SET

/* THIS COMPILES DATA BASE SET-UP PROGRAM

FTN FSETUP -64V -DCLVAR

FTN F-ATTACH -64V -DCLVAR

FTN F-ICONV -64V -DCLVAR

FTN F-NEWJCL -64V -DCLVAR

FTN FBANNER -64V -DCLVAR

FTN F APPEND -64V -DCLVAR

FTN FGETFIL -64V -DCLVAR

/* A1DENKER > RUN SET

/* THIS LOADS THE DATA BASE SET-UP PROGRAM INTO #SET

FILMEN ALL

SEG

VLOAD #SET

LOAD B_F_SETUP

LOAD BFATTACH

LOAD BFGETFIL

LOAD B_F_ICONV

LOAD B F NEWJCL

LOAD BFBANNER

LOAD BFAPPEND

LIBRARY

LIBRARY VAPPLB

LIBRARY SFTNLB

LIBRARY IFTNLB17

SAVE #SET

QUIT

/* AlDENKER >SPOOLALL

/ SPOOLS ALL THE FORTRAN CODE FOR BOTH PHANTOM TA

/ AND DATA BASE SET-UP PROGRAMS. EACH ROUTINE IS

/ STARTED ON A NEW PAGE

CONCAT TEMPI PH TA F JOBINP F TAINP F DECIDE F APPEND

CONCAT TEMP2 FGETFIL FREADTL FCHGSTD FRESET

CONCAT TEMP3 FWAIV FCHANGE FPRINT FNEWJCL FRUNJOB. HASP

CONCAT TEMP4 F RUNJOB.2780 F BANNER F NMCRMP F SRCH01

CONCAT TEMP5 FSRCH02 FSRCH03 FNMWAIV FPARSE FCOMPAR

CONCAT TEMP6 FCHCKMP FICONV FATTACH FHRPORT FLOGNAM

CONCAT PHANTOMTA TEMPI TEMP2 TEMP3 TEMP4 TEMP5 TEMP6

F SET UP

DELETE TEMPI

DELETE TEMP2

DELETE TEMP3

DELETE TEMP4

DELETE TEMP5

DELETE TEMP6

QED PHANTOM TA

1,SC./?/ &/

iSC. I SUBROUTINE/1 SUBROUTINE/

1, SC./ FUNCTION/1 FUNCTION/

/ C THIS PROGRAM IS AN

C.! /1/

SPOOL PHANTOMTA -FTN

DELETE PHANTOMTA

/* AlDENKER > SAVEALL

/* CREATES SECOND COPY OF ALL FORTRAN ROUTINES

COPY FPH TA SAVEPHTA

COPY FJOBINP SAVEJOBINP

COPY FTAINP SAVETAINP

COPY FDECIDE SAVEDECIDE

COPY F APPEND SAVE APPEND

COPY FGETFIL SAVEGETFIL

COPY FREADTL SAVEREADTL

COPY FCHGSTD SAVE CHGSTD

COPY FRESET SAVERESET

COPY FWAIV SAVE WAIV

COPY FCHANGE SAVECHANGE

COPY FPRINT SAVEPRINT

COPY FNEWJCL SAVENEWJCL

COPY F RUNJOB. HASP SAVE RUNJOB. HASP

COPY FRUNJOB.2780 SAVERUNJOB.2780

COPY FBANNER SAVEBANNER

COPY F NMCRMP SAVE NMCRMP

COPY FSRCH01 SAVESRCH01

COPY FSRCH02 SAVESRCH02

COPY FSRCH03 SAVESRCH03

COPY FNMWAIV SAVENMWAIV

COPY FPARSE SAVEPARSE

COPY FCOMPAR SAVECOMPAR

COPY FCHCKMP SAVECHCKMP

COPY FICONV SAVEICONV

COPY FATTACH SAVEATTACH

COPY FHRPORT SAVEHRPORT

COPY FSETUP SAVESETUP

COPY F LOGNAM SAVE LOGNAM

VI. Appendix - Fortran Code

C CONTROL STRUCTURE FOR PHANTOM TA PROGRAM,C THIS IS THE MAIN MODULE

C. INSERT SYSTEM KEYS$INSERT SYSCOM>A$KEYS$INSERT SYSCOM>KEYS.F

C DECLARATION OF VARIABLESINTEGER TIME(4),INBUFF(40),RETBUF(40),WATBUF(40),EODRUN,

+CRSNUM, TEMP(3) ,FUNITCODE, ITIMEI,IREP,TSTBUF(40) ,UNIT,+DELBUF (40)

REAL*4 TIMVALINTEGER*4 REPORTVALUEPTRLOGICAL COMFLG,TRUEFALSELGCODERUN1,RUN2

COMMON/MAIN/COMFLG

DATA RETBUF/+'SEG AlDENKER>#PHTA+'/

DATA WATBUF/+'WAITFOR -0900+

DATA DELBUF/+'DELETE AlDENKER:NTRUMP>CRSFIL>LOGFIL+ '/

C SYSTEM KEYSC A$DEC=l /* DECIMAL */

TRUE=.TRUE.FALSE=. FALSE.COMFLG=.FALSE,

C MAKE THE END-OF-DAY RUN AT 6:00 PMEODRUN=18

C*** START ***

C DELAY FOR ONE MINUTE10 CALL SLEEP$(060000)

C CLOSE ALL FILE UNITS TO PREVENT HANGUPDO 15 FUNIT=1,15CALL CLOS$A (FUNIT)

15 CONTINUE

C CLEAR COMMAND FILECALL ATTACH('CMDFIL',6,FUNIT)CALL TRNC$A(FUNIT)CALL CLOS$A (FUNIT)

C SET THE CURRENT TIME VALUETIMVAL=TIME$A(TIME)

ITIME=TIMVAL

C CALL SUBROUTINE TO HANDLE INPUT OF STUDENT JOBSCALL JOBINP

C CALL SUBROUTINE TO HANDLE INPUT OF TA COMMAND FILESCALL TAINP

C IF IT IS BEFORE TIME FOR END OF DAY RUN, SKIP OVER ITIF (ITIME.LT.EODRUN) GO TO 100

C* END OF THE DAY RUN ***********************************

CALL DECIDE (TRUE)

C PRINT ALL STUDENT INFO FILESCALL ATTACH('INFO ',4,FUNIT)CALL READTL('CRSNM= ',6,INBUFFLGCODEFUNIT)CALL CLOSSA(FUNIT)CALL CNVA$A(A$DECINBUFF(4),2,VALUE)CRSNUM=VALUE

TEMP(1)='CR'TEMP (2)='SN'

DO 20 I=1,CRSNUMTEMP(3)=ICONV(I)CALL PRINT(TEMP)

ZO CONTINUE

C PRINT THE LOGC NOTE: IF NO ENTRIES HAVE BEEN MADE THIS CALL WILL CAUSEC AN ERROR MESSAGE, BUT WIL CAUSE NO PROBLEMS

CALL PRINT('LOGFIL')

C MAKE HOURLY REPORTCALL HRPORT(18)

C ADD DELETE LOGFIL TO CLEAR LOGCALL ATTACH('CMDFIL',6,FUNIT)CALL APPEND (DELBUFFUNIT)

C ADD WAITFOR TO COMMAND FILEC TO WAIT TILL 9:00 AM TOMMORROW TO START RUNNING AGAIN

CALL APPEND (WATBUF, FUNIT)CALL CLOS$A (FUNIT)

C SET COMMAND FILE FLAGCOMFLG=,TRUE.GO TO 200

**** **** ****** ******** ********* ** **** *** * *************

C GET REPORT VALUE, THE REPORT VALUE EQUALS THE HOUR THE NEXTk. REPORT SHOULD BE MADE.

100 CALL ATTACH('INFO ',4,FUNIT)CALL READTL('REP= ',4,INBUFFLGCODEFUNIT)CALL CLOS$A (FUNIT)

CALL CNVA$A(A$DECINBUFF(3),2,REPORT)IREP=REPORT

C IF IT IS BEFORE TIME TO STOP BATCH RUNS,C THEN CALL THE DECIDE SUBROUTINE WHICH DECIDES WHICHC JOBS TO RUN.

RUNl=(ITIME.LT.11)RUN2=(ITIME.GE.12.AND.ITIME.LT.16)IF (RUN1.OR.RUN2) CALL DECIDE(FALSE)

C CHECK IF TIME FOR NOON RUNIF (ITIME.GE.IREP.AND.IREP.EQ.12) CALL DECIDE(TRUE)

C CHECK IF TIME FOR HOURLY REPORTIF (ITIME.GE.IREP) CALL HRPORT(IREP)

C IF NO COMMANDS HAVE BEEN INPUT INTO THE COMMAND FILE ,C GO TO START

200 IF (.NOT.COMFLG) GO TO 10 /* GO TO START */

C ADD RETURN COMMAND TO END OF COMMAND FILECALL ATTACH('CMDFIL',6,FUNIT)CALL APPEND(RETBUF,FUNIT)CALL CLOS$A (FUNIT)

C CALL COMMAND FILEC. THEN WHEN COMI$$ IS SUCCESSFUL, RETURN WILL BE TOC REINITIALIZE AND RESTART PROGRAM.

CALL BANNER (6)CALL ATCH$$('MFD',3,K$ALLD,'PART2',K$IMFD+K$SETH,CODE)CALL

ATCH$$ ('AlDENKER',8,K$ALLD, 'NTRUMP',K$IMFD+K$SETHCODE)CALL ATCH$$('CRSFIL',6,K$CURR,' ',K$ICUR+K$SETH,CODE)DO 300 FUNIT=6,15CALL COMI$$('CMDFIL',6,FUNITCODE)IF (CODE.EQ.0) GO TO 310

300 CONTINUE

310 CALL EXIT

END

SUBROUTINE JOBINP

C THIS ROUTINE HANDLES THE INPUT OF STUDENT JOBS

C INSERT SYSTEM KEYS$INSERT SYSCOM>KEYS.,F$INSERT SYSCOM>SYSCOM>A$KEYS$INSERT SYSCOM>ERRD.F

C DECLARATION OF VARIABLESINTEGER CRS(3),MPNUMJOBSTCRSVAL,DELIMNAME(8),MPVAL,

+EOJCRD(40),BUFFER(40),RESULT(40),INBUFF(40),NRUN,+TEMP(7),INDEXFUNITLIMTSTIWAIVJOB,INPUT,+LIMITSAVE(40),CODEBATCH,RNW,OUTBUF(40),STDCMD(15),+MPJOBVALI,LENGTHJOBFIL(3),UNIT,TSTBUF(40),K,+CRSFIL(3) ,NMINPT

INTEGER*4 VALUE,PTR

LOGICAL NAMFLGFSTCRDCRSFLGMPFLGLGTEMP,LGCODE,+SNDCRDOPEN$A

DATA EOJCRD/+'$EOJ+

DATA STDCMD/'CRS ', '

SYSTEM-KEYSK$IMFD=:0K$SETH=:1K$ALLD=:100000A$SAMF=0A$ABS=1A$DEC=1E$EOF=1

JOBFIL (1)='JO'JOBFIL(2)='BN'

C*** 10 ***

/* UFD IS IN MFD *//* SET HOME UFD *//* SEARCH ALL DISKS *//* OPEN NEW SAMF FILE *//* ABSOLUTE POSITION *//* DECIMAL *//* END OF FILE */

/* GET NEXT FILE */

C ATTACH TO STUDENT INPUT FILE10 CALL ATCH$$('MFD',3,K$ALLD,'PART2',K$IMFD+K$SETHCODE)

CALL ATCH$$('INFIL',5,K$ALLD,'MISCRS',K$IMFD+K$SETHCODE)

C FIRST CLEAR NAMECRS, AND MP

DO 16 I=1,8NAME(I)='

16 CONTINUE

DO 17 1=1,3CRS(I)='

17 CONTINUE

MP=' 00'

C GET FILE NAMECALL GETFIL(NAMELENGTHLGTEMP)IF (LGTEMP.AND.LENGTH.GT.0) GO TO 18RETURN

C NEW FILE, FIRST SHOULD BE A CONTROL CARD18 FSTCRD=.TRUE.

SNDCRD=. FALSE.PTR=0

C*** 20 *** /* GET NEXT CARD OF FILE*/

20 CALL ATCH$$('MFD',3,KSALLD,'PART2',KSIMFD+K$SETHCODE)CALL ATCH$$('INFIL',5,K$ALLD,'MISCRS',K$IMFD+K$SETHCODE)

DO 21 FUNIT=1,15LGTEMP=OPEN$A(K$RDWR+A$SAMF,NAME,LENGTHFUNIT)IF (LGTEMP) GO TO 22

21 CONTINUERETURN

C SAVE LAST CARD22 DO 23 I=1,40

SAVE (I)=BUFFER(I)23 CONTINUE

C POSITION TO SAVED POINTER POSITIONCALL POSN$A(A$ABSFUNITPTR)

C READ CARDUNIT=FUNIT+4READ(UNIT,25,END=200) BUFFER

25 FORMAT(40A2)

C SAVE NEW POSITION FOR NEXT READCALL RPOS$A(FUNITPTR)CALL CLOS$A(FUNIT)IF(.NOT.FSTCRD) GO TO 100

C CHECK IF FIRST CARD IS A CONTROL CARDIF (BUFFER(1).EQ.'**') GO TO 30

CALL BANNER(l)CALL NMCRMP(NAMECRSMP,1)CALL TNOU('NO JOB INPUT CARD, CANT PROCESS DECK',36)CALL TNOUA('CARD=',5)CALL TNOU(BUFFER,80)CALL TNOU(' ',1)GO TO 500 /* GO TO DELETE FILE */

C PROCESSING CONTROL CARD

C CRSFLG IS SET TO TRUE, WHEN AN IMPROPER COURSE IS INPUTC MPFLG IS SET TO TRUE, WHEN AN IMPROPER MACHINE PROBLEM ISINPUT

30 CRSFLG=.FALSE.MPFLG=. FALSE.

CALL PARSE (BUFFERRESULT,2,STDCMD,3,1)

DO 55 I=1,3CRS(I)=RESULT(I)

55 CONTINUE

MP=RESULT(9)

IF (CRS(1).NE.' ') GO TO 60

CALL BANNER(l)CALL NMCRMP(NAMECRSMP,1)CALL TNOU('NO COURSE IDENTIFIED',20)CALL TNOUA('CARD=',5)CALL TNOU(BUFFER,80)CALL TNOU(' ',1)CRSFLG=. TRUE.

60 IF (MP.NE.' ') GO TO 65

CALL BANNER(1)CALL NMCRMP (NAMECRSMP, 1)CALL TNOU('NO MACHINE PROBLEM IDENTIFIED',29)CALL TNOUA('CARD=',5)CALL TNOU(BUFFER,80)CALL TNOU(' ',1)MPFLG=.TRUE.

65 IF (CRSFLG) GO TO 70CALL SRCH01(CRSMPNUM,JOBST,CRSVALDELIM)IF (CRSVAL.NE.0) GO TO 70

CALL BANNER(1)CALL NMCRMP(NAMEICRSMP,1)CALL TNOU('IDENTIFIED COURSE INVALID',25)CALL TNOUA('CARD=',5)CALL TNOU (BUFFER, 80)CALL TNOU(' ',1)CRSFLG=.TRUE.

70 IF (MPFLG) GO TO 75CALL CNVA$A(A$DEC,MP,2,VALUE)MPVAL=VALUE

IF (MPVAL.GT.0.AND.MPVAL.LE.MPNUM) GO TO 75

CALL BANNER(l)CALL NMCRMP(NAMECRSMP,1)

CALL TNOU('IDENTIFIED MACHINE PROBLEM INVALID',34)CALL TNOUA('CARD=',5)CALL TNOU(BUFFER,80)CALL TNOU(' ',1)MPFLG=. TRUE.

75 I-F (CRSFLG) GO TO 500 /* GO TO DELETE FILE */

CALL SRCH02(NAMECRSVALMPVALNRUN,LIMIT,NAMFLG)IF (NAMFLG) GO TO 80

CALL BANNER(1)CALL NMCRMP(NAMECRSMP,1)CALL TNOU('NAME NOT REGISTERED FOR THIS COURSE',35)CALL TNOU(' ',1)GO TO 500 /* GO TO DELETE FILE */

80 IF (MPFLG.OR.CRSFLG) GO TO 500 /* GO TO DELETE FILE */

CALL NMWAIV(NAMECRS,MP,IWAIV)LIMTST=LIMIT+IWAIV-NRUNIF (LIMTST.GT.0) GO TO 85

CALL BANNER(1)CALL NMCRMP(NAMECRSMP,1)CALL TNOU('OVER RUN LIMIT',14)CALL TNOU(' '1)GO TO 500 /* GO TO DELETE FILE */

85 FSTCRD=.FALSE.SNDCRD=. TRUE.GO TO 20 /* GO TO GET NEXT CARD */

C*** 100 *** /* PROCESS CARD OTHER THAN FIRST */

C CHECK IF DELIMITER USED100 IF (BUFFER(1).NE.DELIM) GO TO 150

CALL BANNER(2)CALL NMCRMP (NAMECRSMP, 2)CALL TNOU('CONTROL DELIMITER USED IN FIRST COLUMN',38)CALL TNOUA('CARD=',5)CALL TNOU(BUFFER,80)CALL TNOU(' 'l)

C SHIFT CARD TWO CHARACTERS TO THE RIGHTDO 110 I=2,40K=42-IBUFFER(K)=BUFFER(K-l)

110 CONTINUEBUFFER(l)='

150 IF (.NOT.SNDCRD) GO TO 160

C IF SECOND CARDC FIRST CHECK IF ZERO JOBS ARE INPUT,

C IF ZERO THEN FILE NEEDS TO BE CLEARED OF LAST BATCHSNDCRD=.FALSE.TEMP(1)='JO'TEMP (2)='B='JOBVAL=JOBST+MPVAL-1TEMP(3)=ICONV(JOBVAL)DO 155 I=4,7TEMP(I)='

155 CONTINUE

CALL ATTACH('INFO ',4,FUNIT)CALL READTL(TEMP,6,INBUFFLGCODE,FUNIT)CALL CLOS$A(FUNIT)INPUT=INBUFF (13)CALL CNVA$A(A$DEC,INPUT,2,VALUE)IF (VALUE.NE.0) GO TO 160

C CLEAR FILEJOBFIL(3)=ICONV(JOBVAL)CALL ATTACH(JOBFIL,6,FUNIT)CALL TRNC$A (FUNIT)CALL CLOS$A(FUNIT)

C APPEND CARD TO SPECIFIED FILE160 JOBFIL(3)=ICONV(JOBVAL)

CALL ATTACH(JOBFIL,6,FUNIT)CALL APPEND (BUFFERFUNIT)CALL CLOS$A(FUNIT)GO TO 20 /* GO TO GET NEXT CARD */

C*** 200*** /* END OF STUDENT JOB */

C TEST IF LAST CARD OF DECK IS EOJCARD200 DO 201 I=1,40

IF(SAVE(I).NE.EOJCRD(I)) GO TO 205201 CONTINUE

GO TO 210

205 JOBFIL(3)=ICONV(JOBVAL)CALL ATTACH(JOBFIL,6,FUNIT)CALL APPEND(EOJCRD,FUNIT)CALL CLOS$A(FUNIT)

CALL BANNER(2)CALL NMCRMP(NAME,CRSMP,2)CALL TNOU('END-OF-JOB CARD APPENDED TO END OF DECK',40)CALL TNOU(' ',1)

210 CALL ATTACH('TEMP ',4,FUNIT)CALL TRNC$A (FUNIT)CALL CLOSSA(FUNIT)

C INCREMENT THE NUMBER OF JOBS INPUT FOR THIS MPTSTBUF (1)='JO'

TSTBUF (2)='B='TSTBUF (3) =ICONV (JOBVAL)DO 211 1=4,7TSTBUF(I)='

211 CONTINUEPTR=0

215 CALL ATTACH('INFO ',4,FUNIT)UNIT=FUNIT+4CALL POSN$A(A$ABS,FUNITPTR)READ(UNIT,220,END=250) INBUFF

220 FORMAT(40A2)CALL RPOS$A(FUNITPTR)CALL CLOS$A(FUNIT)CALL COMPAR(TSTBUF,1,INBUFF,1,6,LGCODE)IF (LGCODE) GO TO 240

230 CALL ATTACH('TEMP ',4,FUNIT)CALL APPEND (INBUFF,FUNIT)CALL CLOS$A(FUNIT)GO TO 215

240 BATCH=INBUFF (8)INPUT=INBUFF(13)

CALL CNVA$A(A$DEC,INPUT,2,VALUE)INDEX=VALUE+lINPUT=ICONV(INDEX)NMINPT=INPUTINBUFF (13) =INPUTGO TO 230

250 CALL CLOS$A(FUNIT)CALL DELE$A('INFO',4)CALL CNAM$$('TEMP'14,'INFO',4,CODE)

C INCREMENT NUMBER OF JOBS INPUT FOR THIS STUDENT300 DO 310 I=1,8

TSTBUF (I)=NAME (I)310 CONTINUE

DO 311 I=9,40TSTBUF(I)='

311 CONTINUEPTR=0CRSFIL (1)='CR'CRSFIL (2)='SN'CRSFIL (3) =ICONV (CRSVAL)

320 CALL ATTACH(CRSFIL,6,FUNIT)UNIT=FUNIT+4CALL POSN$A(A$ABSFUNITPTR)READ(UNIT,330,END=400) INBUFF

330 FORMAT (40A2)CALL RPOS$A(FUNITPTR)CALL CLOS$A(FUNIT)CALL COMPAR(TSTBUF,1,INBUFF,1,16,LGCODE)IF (LGCODE) GO TO 350

340 CALL ATTACH('TEMP ',4,FUNIT)

CALL APPEND(INBUFF,FUNIT)CALL CLOS$A (FUNIT)GO TO 320

350 INDEX=8+4*MPVALINPUT=INBUFF(INDEX)CALL CNVA$A(A$DEC,INPUT,2,VALUE)I-NPUT=VALUE+lINBUFF(INDEX)=ICONV(INPUT)INPUT=ICONV(INPUT)GO TO 340

400 CALL CLOS$A(FUNIT)CALL DELE$A(CRSFIL,6,FUNIT)CALL CNAM$$('TEMP',4,CRSFIL,6,CODE)

C PRINT JOB SUCCESSFULLY INPUT MESSAGE ON COMMAND CONSOLECALL BANNER(5)CALL NMCRMP(NAMECRSMP,5)CALL TNOUA('IT IS ',6)CALL TNOUA (NMINPT, 2)CALL TNOUA('/',1)CALL TNOUA(BATCH,2)CALL TNOU(' OF JOBS NEEDED FOR THIS RUN',28)CALL TNOU(' '1)

C ADD NAME TO LOGCALL LOGNAM(NAMEJOBVAL)

C*** 500*** /* DELETE THE CURRENT STUDENT FILE */

C CLOSE FILE UNIT500 DO 505 FUNIT=2,15

CALL CLOS$A (FUNIT)505 CONTINUE

CALL ATCH$$('MFO',3,K$ALLD,'PART2',K$IMFD+K$SETHCODE)CALL ATCH$$('INFIL',5,K$ALLD,'MISCRS',K$IMFD+K$SETHCODE)CALL DELE$A(NAMELENGTH)GO TO 10 /* GO TO GET NEXT FILE */

END

SUBROUTINE TAINP

C THIS ROUTINE HANDLES THE INPUT OF TA JOBS

C INSERT SYSTEM KEYS$INSERT SYSCOM>KEYS.F$INSERT SYSCOM>SYSCOM>A$KEYS$INSERT SYSCOM>ERRD.F

C DECLARATION OF VARIABLESINTEGER TACOMM(60),RESULT(40),TBUFF(5),CRSNUM,

+DELNAM(8),NAME(8),FILE(5),CRS(3),PASSWD(3),TEMP(3),NUM(2),+MPNUMJOBSTCRSVALDELIMLIMITASP,MPVALJOBVAL,+CODEMPINBUFF(40),BUFFER(40),SAVESTD(8),UNIT,+LASTFUNIT,I,K,J,LENGTH,CHARlCHAR2,NRUN

INTEGER ADDBUF(15),WAVBUF(15),CHABUF(15),JCLBUF(15),+RUNBUF(15),TACMD(15)

INTEGER*4 PTRVALUELOGICAL FSTCRDPASFLGNAMFLG,LGTEMPNAMEQVOPEN$A,+LGCODECRSFLGCRSFLG,PSWFLGADD

DATA ADDBUF/'STDDATA WAVBUF/'STDDATA CHABUF/'MPDATA JCLBUF/'MPDATA RUNBUF/'MPDATA TACMD/'CRSDATA TACOMM/'ADD+'CHANGE ','RESE+'RUNCRS ,'RUNA+'PRINTALL '/

', '

''MP ','NUM','NUM ','

, 'FILE ,

','PASSW ','

','DELETET ','JCLLL ','PRINTLOG

','WAIVERI ,'RUN',

','PRINTINFO ',

SYSTEM KEYSK$IMFD=:0 /* UFD IS IN MFD */K$SETH=:1 /* SET HOME UFD */K$RDWR=:3 /* OPEN FOR READING AND WRITING */K$ALLD-:100000 /* SEARCH ALL DISKS */A$SAMF=0 /* OPEN NEW SAM FILE */A$ABS=l /* ABSOLUTE POSITION */A$DEC=1 /* DECIMAL */E$EOF=l /* END OF FILE */

ASP=LT(' ',8)

C*** 10*** /* GET NEXT FILE */

10 CALL ATCH$$('MFD',3,K$ALLD,'PART2',K$IMFD+K$SETHCODE)CALL ATCH$$('TAINP',5,K$ALLD,'TAPASS',K$IMFD+K$SETH,CDDE)

C CLEAR INFORMATION FROM PREVIOUS JOBSDO 11 I=1,3PASSWD(I)='

11 CONTINUE

DO 12 I=1,3CRS(I)='

12 CONTINUE

DO 13 I=1,8NAME(I)='

13 CONTINUE

C GET FILE NAMECALL GETFIL(NAMELENGTHLGTEMP)IF (LGTEMP.AND.LENGTH.GT.0) GO TO 18RETURN

18 FSTCRD=.TRUE.PTR=0

C*** 20*** /* READ NEXT CARD */

20 CALL ATCH$$('MFD',3,K$ALLD,'PART2',K$IMFD+K$SETHCODE)CALL ATCH$$('TAINP',5,K$ALLD,'TAPASS',K$IMFD+K$SETHCODE)

DO 21 FUNIT=1,15LGTEMP=OPEN$A(K$RDWR+A$SAMFNAMELENGTHFUNIT)-IF (LGTEMP) GO TO 22

21 CONTINUERETURN

C POSITION TO SAVED POINTER POSITI~ON22 CALL POSN$A(A$ABSFUNITPTR)

C READ CARDUNIT=FUNIT+4READ(UNIT,25,END=500) BUFFER

25 FORMAT(40A2)

C SAVE NEW POINTER POSITION FOR NEXT READCALL RPOS$A(FUNITPTR)CALL CLOS$A(FUNIT)

IF (.NOT.FSTCRD) GO TO 100

C PROCESSING CONTROL CARDIF (BUFFER(l).EQ.'**') GO TO 30

CALL BANNER(3)CALL NMCRMP(NAMECRSMP,3)CALL TNOU('NO USER INPUT CARD, CANT PROCESS DECK',37)CALL TNOUA('CARD=',5)CALL TNOU (BUFFER, 80)CALL TNOU(' ',1)GO TO 500 /* GO TO DELETE FILE */

30 CRSFLG=.FALSE.

PSWFLG=. FALSE.CALL PARSE(BUFFER,RESULT,2,TACMD,3,3)

DO 50 I=1,3K=I+8CRS (I) =RESULT (I)PASSWD (I) =RESULT (K)

50 CONTINUE

IF (CRS(1).NE.' ') GO TO 55

CALL BANNER(3)CALL NMCRMP(NAMECRSMP,3)CALL TNOU('NO COURSE IDENTIFIED',20)CALL TNOUA('CARD=',5)CALL TNOU (BUFFER, 80)CALL TNOU(' ',1)CRSFLG=.TRUE.

55 IF (PASSWD(l).NE.' ') GO TO 57

CALL BANNER(3)CALL NMCRMP(NAMECRSMP,3)CALL TNOU('NO PASSWORD IDENTIFIED',22)CALL TNOUA('CARD=',5)CALL TNOU(BUFFER,80)CALL TNOU(' ',1)PSWFLG=. TRUE.

57 IF (CRSFLG) GO TO 500 /* GO TO DELETE FILE */CALL SRCH01(CRSMPNUM,JOBSTCRSVAL,DELIM)IF (CRSVAL.GT.0) GO TO 60

CALL BANNER(3)CALL NMCRMP(NAME,CRSMP,3)CALL TNOU('INVALID COURSE SPECIFIED',24)CALL TNOUA('CARD=',5)CALL TNOU(BUFFER,80)CALL TNOU(' ',1)GO TO 500 /* GO TO DELETE FILE */

60 IF (CRSFLG.OR.PSWFLG) GO TO 500 /* GO TO DELETE FILE */CALL SRCH03(NAMECRSPASSWDPASFLG)IF (PASFLG) GO TO 65

CALL BANNER(3)CALL NMCRMP(NAMECRSMP,3)CALL TNOU('NO RIGHT, IMPROPER NAME OR PASSWD',35)CALL TNOUA('CARD=',5)CALL TNOU(BUFFER,80)CALL TNOU(' ',1)GO TO 500 /* GO TO DELETE FILE */

65 FSTCRD=.FALSE.

GO TO 20 /* READ NEXT CARD */

C*** 100*** /* PROCESS CARD OTHER THAN FIRST CARD */

C INPUT OF USER COMMANDS

100 DO 110 I=1,5LAST=ICHAR1=LT(BUFFER(I),8)CHAR2=LS (BUFFER (I) ,8)IF (CHARl.EQ.ASP) GO TO 120IF (CHAR2.EQ.ASP) GO TO 115TBUFF (I) =BUFFER (I)

110 CONTINUEGO TO 140

115 TBUFF(I)=BUFFER(I)LAST=LAST+1

120 DO 130 I=LAST,5TBUFF(I)='

130 CONTINUE

140 K=1

C LOOK FOR COMMANDDO 150 I=1,12IF (NAMEQV(TBUFFTACOMM(K))) GO TO (200,210,220,230,240,

+250,260,270,280,290,300,310),IK=K+5

150 CONTINUE

CALL BANNER(3)CALL NMCRMP(NAMECRSMP,3)CALL TNOU('BAD COMMAND INPUT',17)CALL TNOUA('CARD=',5)CALL TNOU(BUFFER,80)CALL TNOU(' ',1)GO TO 20 /* GO TO PROCESS NEXT CARD */

C* ***** ********* ******** ****************** ************* ******

C ADD STUDENT

200 CALL PARSE(BUFFER,RESULT,1,ADDBUF,4,3)

DO 205 I=1,8STD(I)=RESULT(I)

205 CONTINUE

ADD=.TRUE.CALL CHGSTD(CRSSTDADD)

C GIVE ACKNOWLEDGMENT TO USERCALL BANNER(7)CALL TNOUA('STUDENT ADDED STD=',19)

CALL TNOUA(STD,16)CALL TNOUA(' CRS=',6)CALL TNOU(CRS,6)GO TO 20 /* GO TO PROCESS NEXT CARD */

C* **** ****** ******************* ******* ***********************

C DELETE STUDENT

210 CALL PARSE(BUFFERRESULT,l,ADDBUF,7,3)

DO 215 I=1,8STD (I)=RESULT(I)

215 CONTINUE

ADD=.FALSE.CALL CHGSTD(CRSSTDADD)

C GIVE ACKNOWLEDGEMENT TO USERCALL BANNER(7)CALL TNOUA('STUDENT DELETED STD=',21)CALL TNOUA (STD, 16)CALL TNOUA(' CRS=',6)CALL TNOU(CRS,6)GO TO 20 /* GO TO PROCESS NEXT CARD */

C* ***********************************************************

C WAIVER STUDENT

220 CALL PARSE(BUFFERRESULT,3,WAVBUF,7,3)

DO 221 I=1,8STD(I)=RESULT(I)

221 CONTINUE

MP=RESULT (9)NUM(1)=RESULT(17)NUM(2)=RESULT(18)

CALL CHCKMP(CRSMPCRSVALMPVALJOBVAL,3)CALL SRCH02(STDCRSVAL,1,NRUNLIMITNAMFLG)IF (NAMFLG) GO TO 222

CALL BANNER(3)CALL NMCRMP(NAMECRSMP,3)CALL TNOU('INCORRECT STUDENT NAME',22)CALL TNOUA('CARD=',5)CALL TNOU (BUFFER, 80)CALL TNOU(' ',1)GO TO 20 /* GO TO PROCESS NEXT CARD */

222 IF (MPVAL.EQ.0) GO TO 20 /* GO TO PROCESS NEXT CARD */CALL WAIV(STDCRSMP,NUM)

C GIVE ACKNOWLEDGEMENT TO USERCALL BANNER(7)CALL TNOUA('WAIVER ADDED STD=',18)CALL TNOUA(STD,16)CALL TNOUA(' CRS=',6)CALL TNOUA(CRS,6)CALL TNOUA(' MP=',5)CALL TNOUA(MP,2)CALL TNOUA(' NUM=',6)CALL TNOU(NUM,4)GO TO 20 /* GO TO PROCESS NEXT CARD */

C* ********************************

C CHANGE RUN LIMIT

230 CALL PARSE(BUFFERRESULT,2,CHABUF,7,3)MP=RESULT (1)NUM(1)=RESULT(9)NUM(2)=RESULT(10)

CALL CHCKMP(CRSMPCRSVALMPVALJOBVAL,3)IF (MPVAL.EQ.0) GO TO 20 /* GO TO PROCESS NEXT CARD */CALL CHANGE (CRS,MPNUM)

C GIVE ACKNOWLEDGEMENT OT USERCALL BANNER(7)CALL TNOUA('RUN LIMIT CHANGED CRS=',23)CALL TNOUA(CRS,6)CALL TNOUA(' MP=',5)CALL TNOUA(MP,2)CALL TNOUA(' NUM=',6)CALL TNOU(NUM,4)GO TO 20 /* GO TO PROCESS NEXT CARD */

C* ***********************************************************

C RESET BATCH LIMIT FOR MACHINE PROBLEM

240 CALL PARSE(BUFFERRESULT,2,CHABUF,6,3)MP=RESULT (1)NUM (1)=RESULT (9)NUM(2)=RESULT(10)

CALL CHCKMP (CRSMPCRSVALMPVAL,JOBVAL, 3)IF (MPVAL.EQ.0) GO TO 20 /* GO TO PROCESS NEXT CARD */

CALL RESET (MP,NUMCRS)CALL BANNER(7)CALL TNOUA('BATCH LIMIT RESET CRS=',23)CALL TNOUA(CRS,6)CALL TNOUA(' MP=',5)CALL TNOUA(MP,2)

CALL TNOUA(' NUM=',6)CALL TNOU(NUM,4)GO TO 20 /* GO TO PROCESS NEXT CARD */

C************ ************* ************* *********************

C NEW-JCL FILE

250 CALL PARSE(BUFFERRESULT,2,JCLBUF,4,3)

DO 251 I=1,5FILE(I)=RESULT(I+8)

251 CONTINUE

MP=RESULT (1)

CALL CHCKMP(CRSMPCRSVAL,MPVALJOBVAL,3)IF (MPVAL.EQ.0) GO TO 20 /* GO TO PROCESS NEXT CARD */

CALL NEWJCL (JOBVAL, FILE)GO TO 20 /* GO TO PROCESS NEXT CARD */

C* ***** ******************************************************

C RUN A MACHINE PROBLEM

260 CALL PARSE(BUFFERRESULT,1,RUNBUF,4,3)MP=RESULT (1)

CALL CHCKMP (CRSMP,CRSVALMPVALJOBVAL, 3)IF (MPVAL.EQ.0) GO TO 20 /* GO TO PROCESS NEXT CARD */

262 CALL RUNJOB(JOBVAL)GO TO 20 /* GO TO PROCESS NEXT CARD */

C** ********************************************* ***********

C RUN COURSE

270 CALL SRCH01(CRSMPNUMJOBSTCRSVALDELIM)

LAST=JOBST+MPNUM-1DO 271 I=JOBST,LASTCALL RUNJOB(I)

271 CONTINUEGO TO 20 /* GO TO PROCESS NEXT CARD */

***** ************* ******************************************

C RUNALL

280 LGTEMP=.TRUE.CALL DECIDE(LGTEMP)GO TO 20 /* GO TO PROCESS NEXT CARD */

C* ***********************************************************

C PRINTLOG

290 CALL PRINT('LOGFIL')GO TO 20 /* GO TO PROCESS NEXT CARD */

C***** *********************** ********************** **********

C PRINTINFO

300 CALL SRCH01(CRSMPNUMJOBSTCRSVALDELIM)TEMP (1)='CR'TEMP (2)='SN'TEMP(3)=ICONV(CRSVAL)CALL PRINT.(TEMP)

/* GO TO PROCESS NEXT CARD */

C PRINTALL310 SAVE=FUNIT

CALL ATTACH('INFO ',4,FUNIT)CALL READTL('CRSNM= ',6,INBCALL CLOS$A(FUNIT)FUNIT=SAVECALL CNVA$A(A.$DECINBUFF(4) ,2,VALUE)CRSNUM=VALUETEMP(l)='CR'TEMP (2)='SN'

DO 315 I=lCRSNUMTEMP (3)=ICONV (IICALL PRINT(TEMP)

315 CONTINUEGO TO 20 /* GO TO PROCESS NEXT C

UFFLGCODEFUNIT)

ARD */

C********************** **************************************

C*** 500*** /* DELETE CURRENT FILE */

C CLOSE FILE UNIT500 CALL CLOS$A(FUNIT)

CALL ATCH$$('MFD',3,K$ALLD, 'PART2',K$IMFD+K$SETHCODE)CALL ATCH$$('TAINP',5,K$ALLD,'TAPASS',K$IMFD+K$SETH,CODE)CALL DELE $A (NAME, LENGTH)GO TO 10 /* GO TO GET NEXT FILE */

END

GO TO 20

SUBROUTINE DECIDE(EODFLG)

C DECIDE- LOOKS THROUGH THE FILE, TAINP>CRSFIL>INFO, TO SEEC WHICH JOBS TO RUN. IT CALLS RUNJOB FOR ALL JOBS INC FILE IF EODFLG IS SET, ELSE IT CALLS RUNJOB ONLY IFC THE NUMBER INPUT IS GREATER THAN OR EQUAL TO THE-C - BATCH SIZE FOR THE JOB.

C EODFLG= END OF DAY FLAG, IF TRUE THEN THIS IS THE END OFC DAY RUN AND ALL JOBS SHOULD BE RUN.

C INSERT SYSTEM KEYSSINSERT SYSCOM>A$KEYS

C INPUT PARAMETERLOGICAL EODFLG

C DECLARATION OF VARIABLESINTEGER INBUFF(40),OUTBUF(40),CMDBUF(15),FUNITJOB,BATCH,

+INPUTCODE,CARD(40),JOBVALCODEINPVALJOBLIN(8),JOBNUM,IINTEGER*4 VALUE,PTRLOGICAL LGCODE

DATA CMDBUF/'JOB ','BATCH ','INPUT ',+1 '/

C SYSTEM KEYSC A$DEC=1 /* DECIMAL */

JOBNUM=1JOBLIN (1)='JO'JOBLIN (2)='B='DO 1 I=3,8JOBLIN(I)='

1 CONTINUE

5 CALL ATTACH('INFO ',4,FUNIT)JOBLIN(3)=ICONV(JOBNUM)CALL READTL(JOBLIN,6,INBUFFLGCODEFUNIT)CALL CLOS$A(FUNIT)IF (LGCODE) GO TO 10RETURN

C GET INFORMATION FROM FILE10 CALL PARSE(INBUFFOUTBUF,4,CMDBUF,1,2)

JOB=OUTBUF(l)BATCH=OUTBUF (9)INPUT=OUTBUF (17)

CALL CNVA$A(A$DECJOB,2,VALUE)JOBVAL=VALUE

80

CALL CNVA$A (A$DEC ,BATCH, 2,VALUE)BATCH=VALUE

CALL CNVA$A(A$DECINPUT,2,VALUE)INPVAL=VALUE

C MAKE DECISION ON WHETHER TO RUN THIS JOB OR NOTIF (INPVAL.EQ.0) GO TO 20IF (INPVAL.GE.BATCH.OR.EODFLG) CALL RUNJOB (JOBVAL)

20 JOBNUM=JOBNUM+1GO TO 5

END

SUBROUTINE APPEND(BUFFERFUNIT)C APPEND- ADD CONTENTS OF BUFFER TO END OF CURRENTLYC OPEN FILE

C BUFFER= NEW LINE TO BE ADDED TO END OF FILE

C INSERT SYSTEM KEYS$INSERT SYSCOM>KEYS.F

C DECLARATION OF VARIABLESINTEGER BUFFER(40),CODE,NMW,FUNIT,I,UNIT

C SYSTEM KEYSC K$POSN=:3 /* POSITION ONLY */C K$PREA=:10 /* PRE-POSITION ABSOLUTE */

C MOVE POINTER TO END OF FILE,C BY POSITIONING POINTER TO NUMBER LARGER THAN FILEC NOTE: USE PRWF$$ BECAUSE POSN$A GIVES END OF FILE MESSAGE

CALL PRWF$$(K$POSN+K$PREA,FUNITLOC(0),0,1000000,NMWCODE)

C WRITE NEW LINEUNIT=FUNIT+4WRITE(UNIT,10) BUFFER

10 FORMAT(40A2)

RETURNEND

SUBROUTINE GETFIL(NAMELENGTHLGTEMP)C GETFIL- RETURNS THE FILE NAME OF ONE OF THE FILES INC THE CURRENTLY ATTACHED TO UFD. THE FILE NAME ISC TRUNCATED TO 16 CHARACTERS INCLUDING TRAILINGC BLANKS, AND THE LENGTH IN CHARACTERS(NOT INCLUDINGC BLANKS) IS RETURNED IN THE PARAMETER LENGTH. A F-ILEC - NAME GREATER THAN 16 CHARACTERS WILL NOT BE CORRECTLYC HANDLED.

C NAME=FILE NAME RETURNED

C LENGTH=NAME LENGTH IN CHARACTERS

C LGTEMP= TRUE, IF SUCCESSFULC FALSE, OTHERWISE

C INSERT SYSTEM KEYS$INSERT SYSCOM>SYSCOM>A$KEYS

C OUTPUT VARIABLESINTEGER NAME(8),LENGTH

C DECLARATION OF VARIABLESINTEGER ENTRY(24,1),UNITS(1),LEV,CODEENTSIZ,I,FUNIT,

+LNAME(24)LOGICAL LGTEMPTSCN$A

C SYSTEM KEYSC A$CUFD=4 /* DO NOT SCAN SUBUFDS OR SEGDIRS */

C CLOSE ALL FILE UNITSDO 5 FUNIT=1,15CALL CLOS$A(FUNIT)

5 CONTINUE

UNITS(1)=lLEV=0

C GET FILE NAMELGTEMP=TSCN$A(A$CUFD,UNITS,ENTRY,24,ENTSIZ,1,LEV,CODE)IF (.NOT.LGTEMP) RETURN

C COPY FILE FILE NAME INTO OUTPUT PARAMETERDO 10 I=2,9NAME(I-1)=ENTRY(I,1)

10 CONTINUE

DO 20 1=2,24LNAME (I-1)=ENTRY (I,1)

20 CONTINUE

LENGTH=NLEN$A(ENTRY (2,1) ,32)

83

C CHECK NAME LENGTH

IF (LENGTH.LE.16) RETURN

C DELETE SINCE WON'T BE PROPERLY HANDELD

CALL BANNER(1)CALL TNOU('NAME TOO LONG, TRUNCATED TO 16 CHARACTERS',41)CALL TNOUA('NAME=',5)CALL TNOU(LNAMELENGTH)CALL CNAM$$(LNAMELENGTHNAME,16,CODE)LENGTH=16RETURN-

END

SUBROUTINE READTL(BUFFERSIZEINBUFF,LGCODEFUNIT)

C READTL- READ THROUGH THE CURRENTLY OPEN FILE UNTILC THERE IS A LINE THAT STARTS WITH THE SAMEC CHARACTERS AS THE INPUT BUFFER.

C BUFFER* TEXT PATTERN THAT IS LOOKED FORC SIZE= THE LENGTH OF PATTERN IN CHARACTERS(TWO/WORD) TO BEC MATCHED. SHOULD BE EVEN TO INSURE PROPER FUNCTIONINGC INBUFF= THE LAST LINE READ FROM THE FILE, THE ONEC WITH MATCH WITH BUFFER

C INPUT PARAMETERSINTEGER BUFFER(8),SIZEFUNIT

C DECLARATION OF VARIABLESINTEGER CHARINBUFF(40),BUFF1(40),UNIT,ILOGICAL LGCODELGTEMP

LGCODE=. FALSE.UNIT=FUNIT+4

C YOU ARE ALREADY ATTACHED TO FILE, WITH POINTER SET

C*** 10*** /* NEXT LINE */

C READ NEXT LINE10 READ(UNITll,END=25) INBUFF11 FORMAT(40A2)

C CHECK FOR MATCHDO 15 I=1,8BUFFl (I) =BUFFER fI)

15 CONTINUEDO 16 I=9,40BUFF1(I)='

16 CONTINUE

CALL COMPAR(BUFFl,1,INBUFF,1,SIZELGTEMP)IF (LGTEMP) GO TO 20

C CONTINUE THROUGH FILEGO TO 10 /* GO TO GET NEXT LINE */

20 LGCODE=.TRUE.

25 RETURNEND

SUBROUTINE CHGSTD(CRSNAMEADD)

C CHGSTD- IS A ROUTINE TO ADD OR DELETE A STUDENTS NAME TOC OR FROM THE DATA BASE, IT IS INSERTED ALPHABETICALLY TOC THE COURSE SPECIFIED BY INPUT, CRS.

C C-RS=COURSE NAMEC NAME=STUDENTS NAMEC ADD= IF TRUE, ADD THE NAMEC IF FALSE, DELETE THE NAME

C INSERT SYSTEM KEYSSINSERT SYSCOM>KEYS.F$INSERT SYSCOM>A$KEYS$INSERT SYSCOM>ERRD.F

C INPUT PARAMETERSINTEGER CRS (3),NAME(8)LOGICAL ADD

C DECLARATION OF VARIABLESINTEGER INBUFF(40),OUTBUF(40),BUFF(10),CODE,FUNIT,

+MPNUMJOBSTCRSVALDELIMSTMPLA(40),FIRSTINDEX,I,+CRSFIL(3) ,UNITINTEGER*4 PTRLOGICAL LGCODE,DONE,FLAG,ENDFLG

DATA STMP-LA/+'LIMITS: MP1=00 MP2=00 MP3=00 MP4=00 ',+'MP5=00 MP6=00 MP7=00 MP8=00'/

C SYSTEM KEYSC A$ABS=1 /* ABSOLUTE POSITION */

C DETERMINE CRSVALCALL SRCH01(CRSMPNUM,JOBSTCRSVALDELIM)

C ATTACH TO FILE WITH INFORMATION FOR THAT COURSECRSFIL (1)='CR'CRSFIL(2)='SN'CRSFIL (3) =ICONV (CRSVAL)

DONE=.FALSE.ENDFLG=.FALSE.FLAG=.FALSE.PTR=0

C CLEAR TEMP FILECALL ATTACH('TEMP ',4,FUNIT)CALL TRNC$A(FUNIT)CALL CLOS$A(FUNIT)

5 IF (FLAG) GO TO 20

CALL ATTACH(CRSFIL,6,FUNIT)UNIT=FUNIT+4CALL POSN$A(A$ABSFUNITPTR)READ(UNIT,10) INBUFF

10 FORMAT(40A2)CALL RPOS$A(FUNITPTR)CALL CLOS$A (FUNIT)CALL COMPAR(INBUFF,1,STMPLA,1,8,LGCODE)IF (LGCODE) FLAG=.TRUE.CALL ATTACH('TEMP ',4,FUNIT)CALL APPEND(INBUFFFUNIT)CALL CLOS$A (FUNIT)GO TO 5

C REST OF FILE IS STUDENT INFORMATION CARDS20 CALL ATTACH(CRSFIL,6,FUNIT)

UNIT=FUNIT+4CALL POSN$A(A$ABS,FUNITPTR)READ(UNIT,10,END=100) INBUFFCALL RPOS$A(FUNITPTR)CALL CLOS$A (FUNIT)IF (DONE) GO TO 50

C CHECK IF NEW NAME COMES BEFORE NAME JUST READDO 30 I=1,8IF(NAME(I).GT.INBUFF(I)) GO TO 50IF (NAME(I).LT.INBUFF(I)) GO TO 40

30 CONTINUE

DONE=. TRUE.IF (.NOT.ADD) GO TO 20

CALL BANNER(3)CALL NMCRMP(NAMECRS,0,3)CALL TNOUA('STUDENT NAME TO ADD TO THIS COURSE IS ',38)CALL TNOU('NOT UNIQUE',10)CALL TNOU('STUDENT WILL NOT BE ADDED',25)CALL TNOU(' ',1)-CALL DELE$A('TEMP',4)GO TO 200

40 IF (.NOT.ADD) GO TO 50INDEX=8+4*MPNUM

DO 41 ImlINDEXOUTBUF (I) =STMPLA (I)

41 CONTINUE

FIRST=INDEX+1DO 42 I=FIRST,40OUTBUF(I)='

42 CONTINUE

DO 43 I=1,8

OUTBUF (I) =NAME (I)43 CONTINUE

CALL ATTACH('TEMP ',4,FUNIT)CALL APPEND(OUTBUF,FUNIT)CALL CLOS$A(FUNIT)

_ IF (ENDFLG) GO TO 150DONE=.TRUE.

50 CALL ATTACH('TEMP ',4,FUNIT)CALL APPEND(INBUFF,FUNIT)CALL CLOS$A(FUNIT)GO TO 20

100 CALL CLOS$A(FUNIT)ENDFLG=.TRUE.IF (DONE) GO TO 150IF (ADD) GO TO 40CALL BANNER(3)CALL NMCRMP(NAMECRS,0,3)CALL TNOU('CANT FIND STUDENT TO DELETE',27)CALL TNOU(' ',1)CALL DELE$A('TEMP',4)GO TO 200

150 CALL DELE$A(CRSFIL,6)CALL CNAMS$('TEMP',4,CRSFIL,6,CODE)

200 RETURNEND

SUBROUTINE RESET(MPNUMCRS)

C RESETS THE BATCH SIZE TO THE INPUT VALUENUM, FOR THEC MACHINE PROBLEM SPECIFIED BY INPUTSCRS AND MP.

C CHANGES PART OF DATA BASE, TAINP>CRSFIL>INFO

C MP=THE MACHINE PROBLEM TO HAVE ITS BATCH SIZEC RESET, IN ASCII PACKED TWO CHARS/WORDC CRS= THE COURSE FOR WHICH THE MACHINE PROBLEM BATCH SIZEC IS TO BE RESET, IN ASCII PACKED TWO CHARS/WORDC NUM= THE NEW BATCH SIZE, IN ASCII PACKED TWO /WORD

C INSERT SYSTEM KEYS$INSERT SYSCOM>A$KEYS

C INPUT PARAMETERSINTEGER MPNUMCRS(3)

C DECLARATION OF VARIABLESINTEGER MPNUMJOBST,CRSVALDELIM,TSTBUF(40),INBUFF(40),+INDEX,FUNITIUNITCODEMPVALINTEGER*4 VALUEPTRLOGICAL LGCODE

C SYSTEM KEYSC A$ABS=1 /* ABSOLUTE POSITION *

CALL CNVA$A (A$DECMP, 2,VALUE)MPVAL=VALUE

CALL SRCHO1(CRSMPNUMJOBSTCRSVAL,DELIM)

INDEX=MPVAL+JOBST-1C CLEAR TEMP FILE

CALL ATTACH('TERP ',4,FUNIT)CALL TRNC$A (FUNIT)CALL CLOS$A(FUNIT)TSTBUF (1)='JO'TSTBUF (2)='B='TSTBUF (3) =ICONV (INDEX)DO 10 I=4,8TSTBUF(I)='

10 CONTINUEPTR=0

20 CALL ATTACH('INFO ',4,FUNIT)UNIT=FUNIT+4CALL POSN$A(A$ABSFUNITPTR)READ(UNIT,30,END=l00) INBUFF.

30 FORMAT(40A2)CALL RPOS$A(FUNIT,PTR)CALL CLOSSA(FUNIT)CALL COMPAR(TSTBUFl,INBUFF,1,6,LGCODE)

89

IF (LGCODE) INBUFF(8)=NUMCALL ATTACH('TEMP ',4,FUNIT)CALL APPEND(INBUFF, FUNIT)CALL CLOS$A (FUNIT)GO TO 20

100 CALL CLOS$A(FUNIT)GALL DELE$A('INFO',4)CALL CNAM$$('TEMP',4,'INFO',4,CODE)

RETURNEND

SUBROUTINE WAIV(STDCRSMPNUM)C WAIV- ADD A WAIVER TO THE DATA BASE FOR THE MACHINEC PROBLEM SPECIFIED BY INPUTS, STDCRS, AND MP.

C ADDS WAIVER LINE TO FILE TAINP>CRSFIL>INFO

C STD= STUDENT NAME FOR WAIVERC CRS= STUDENTS COURSE FOR WAIVERC MP= MACHINE PROBLEM FOR WAIVERC NUM= NUMBER OF JOBS OVER LIMIT TO BE ALLOWED.C CAN BE POSITIVE OR NEGATIVE

C INPUT PARAMETERSINTEGER STD(5),CRS(3),NUM(2),MP

C DECLARATION OF VARIABLESINTEGER BUFFER(40),WVTMPL(23),FUNIT,I

C WAIVER TEMPLATEDATA WVTMPL/'STD= CRS= MPN=

+'NUM='/

C CONSTRUCT WAIVER LINEDO 5 I=1,23BUFFER (I) =WVTMPL (I)

5 CONTINUE

DO 6 I=24,40BUFFER(I)='

6 CONTINUE

DO 10 I=1,8BUFFER(I+2)=STD (I)

10 CONTINUE

DO 20 I=1,3BUFFER (I+13)=CRS (I)

20 CONTINUE

BUFFER (20) =MPBUFFER(24)=NUM(l)BUFFER (25) =NUM (2)

C APPEND LINE TO FILECALL ATTACH('INFO ',4,FUNIT)CALL APPEND(BUFFERFUNIT)

CALL CLOS$A(FUNIT)RETURNEND

SUBROUTINE CHANGE(CRSMP,NUM)C CHANGE- CHANGE THE LIMIT FOR THE NUMBER OF RUNS ALLOWEDC FOR EVERY STUDENT IN A COURSE FOR THE MACHINEC PROBLEM SPECIFIED BY INPUTS: CRS, AND MP.C THE LIMIT IS CHANGED THE AMOUNT NUM.

C CHANGES FILE TAINP>CRSFIL>CRSN##

C CRS= COURSE NAMEC MP= MACHINE PROBLEM -

C NUM= AMOUNT LIMIT IS TO BE CHANGED, CAN BE POSITIVEC OR NEGATIVE

C INSERT SYSTEM KEYS$INSERT SYSCOM>A$KEYS

C INPUT PARAMETERSINTEGER CRS(3),MP,NUM(2)

C DECLARATION OF VARIABLESINTEGER MPNUMJOBSTCRSVALDELIMJOBVAL,AMTCHANEWVAL,+FUNITINDEXINBUFF(40),MPVALCRSFIL(3),TSTBUF(40),+UNITCODEILOGICAL LGCODEINTEGER*4 VALUE,PTR

C SYSTEM KEYSC A$ABS=1 /* ABSOLUTE POSITION */C A$DEC=1 /* DECIMAL */

CALL SRCH01(CRSMPNUMJOBSTCRSVAL,DELIM)

CALL CNVA$A(A$DEC,MP,2,VALUE)MPVAL=VALUE -

CALL CNVA$A(A$DEC,NUM,4,VALUE)AMTCHA=VALUE

C CLEAR TEMP FILECALL ATTACH('TEMP ',4,FUNIT)CALL TRNC$A(FUNIT)CALL CLOS$A(FUNIT)

CRSFIL(1)='CR'CRSFIL (2)='SN'CRSFIL(3)=ICONV(CRSVAL)TSTBUF (1)='LI'TSTBUF (2)='MI'TSTBUF (3)= 'TS'DO 10 I=4,40TSTBUF(I)='

10 CONTINUE

PTR=020 CALL ATTACH(CRSFIL,6,FUNIT)

UNIT=FUNIT+4CALL POSN$A(A$ABSFUNITPTR)READ(UNIT,30,END=60) INBUFF

30 FORMAT(40A2)CALL RPOS$A(FUNITPTR)CALL CLOS$A(FUNIT)CALL COMPAR(TSTBUF,1,INBUFF,1,6,LGCODE)IF (LGCODE) GO TO 50

40 CALL ATTACH('TEMP ',4,FUNIT)CALL APPEND(INBUFFFUNIT)CALL CLOS$A(FUNIT)GO TO 20

50 INDEX=8+4*MPVALCALL CNVA$A(A$DECINBUFF(INDEX),2,VALUE)NEWVAL=VALUE+AMTCHAINBUFF (INDEX) =ICONV (NEWVAL)GO TO 40

60 CALL CLOS$A(FUNIT)CALL DELESA(CRSFIL,6)CALL CNAM$$('TEMP',4,CRSFIL,6,CODE)

RETURNEND

SUBROUTINE PRINT(FILE)

C PRINT- THIS ROUTINE ADDS A COMMAND TO THE COMMAND FILE TOC SPOOL TO THE PRINTER THE FILE INPUT. IT SETS THEC COMMAND FLAG THAT IS IN COMMON WITH THE CONTROLMODULE.C - NOTE: ATTACH COMMANDS SHOULD NOT BE DELETED, SINCE AC COPY COMMAND MAY CHANGE WHERE THE PROGRAM IS ATTACHED

C ADDS COMMAND TO COMMAND FILEC SETS COMMAND FLAG

C FILE= FILE NAME, LENGTH=6 CHARACTERS,3 WORDS

C INPUT VARIABLESINTEGER FILE(3)

C DECLARATION OF VARIABLESINTEGER BUFFER(40),ATCH1(40),ATCH2(40),

+FUNIT, I

LOGICAL COMFLG

COMMON/MAIN/COMFLG

DATA ATCHl/+'ATTACH AlDENKER NTRUMP+ 1

DATA ATCH2/+'ATTACH CRSFIL 0 2+'/

BUFFER (1)'SP'BUFFER(2)='OO'BUFFER(3)='L '

BUFFER (4)=FILE (1)BUFFER(5)=FILE(2)BUFFER (6)=FILE (3)

DO 10 I=7,40BUFFER(I)='

10 CONTINUE

CALL ATTACH('CMDFIL',6,FUNIT)CALL APPEND(ATCHlFUNIT)CALL APPEND(ATCH2,FUNIT)CALL APPEND(BUFFERFUNIT)CALL CLOS$A (FUNIT)

COMFLG=. TRUE.

RETURN

END

SUBROUTINE NEWJCL(JOBVALFILE)C THIS ROUTINE ADDS A COMMAND TO THE COMMAND FILE THATC COPIES THE SPECIFIED BY THE INPUT, FILE, INTO THE JCLC FILE USED FOR THE JOB SPECIFIED BY JOBVAL. THE INPUTC FILE IS NOT DELETED.

C ADDS COMMAND TO COMMAND FILEC SETS COMMAND FILE FLAG

C JOBVAL= IDENTIFYING NUMBER FOR JOBC FILE= NEWJCL FILE, THAT WILL BE COPIED INTO THE JCL FILEC USED FOR THE JOB SPECIFIED BY JOBVAL.

C INPUT PARAMETERSINTEGER FILE(5),JOBVAL

C DECLARATION OF VARIABLESINTEGER CPYTMP(31),OUTBUF(40),FUNIT,ILOGICAL COMFLG

COMMON/MAIN/COMFLG

DATA CPYTMP/'COPY AlDENKER:NTRUMP> '+' AlDENKER:NTRUMP>CRSFIL>JCLP'/

DO 10 I=1,31OUTBUF (I) =CPYTMP (I)

10 CONTINUE

DO 20 I=32,40OUTBUF(I)='

20 CONTINUE

DO 30 I=12,16OUTBUF(I)=FILE(I-11)

30 CONTINUE

OUTBUF (32) =ICONV(JOBVAL)

CALL ATTACH('CMDFIL',6,FUNIT)CALL APPEND(OUTBUFFUNIT)CALL CLOS$A(FUNIT)COMFLG=. TRUE.

RETURNEND

SUBROUTINE RUNJOB (JOBVAL)

C RUNJOB- FIRST CHECK NUMBER OF JOBS INPUT FOR JOB SPECIFIEDC BY INPUT JOBVAL, IF EQUALS ZERO THEN RETURN, ELSEC RESET NUMBER INPUT TO ZERO, AND ADD HASP COMMANDS TOC COMMAND FILE TO RUN THE BATCH, AND SET THE COMMANDC - FILE FLAG.

C ADDS COMMANDS TO COMMAND FILEC SETS COMMAND FILE INPUT FLAGC CHANGES THE FILE TAINP>CRSFIL>INFO

C JOBVAL= THE IDENTIFYING NUMBER FOR THE JOB TO BE RUN

C INSERT SYSTEM KEYS$INSERT SYSCOM>A$KEYS

C INPUT PARAMETERSINTEGER JOBVAL

C DECLARATION OF VARIABLESINTEGER BUFFER(40),TEMPLA(11),DELIMFUNITUNIT,+TSTBUF(40),INBUFF(40),INPUT,IJOBFIL(3),IVALUE,+CODETIME(4),DATE(8),JOBCRD(15)INTEGER*4 VALUE,PTRLOGICAL COMFLGLGCODE

COMMON/MAIN/COMFLGDATA TEMPLA/'LSEND AlDENKER>CRSFIL>'/DATA JOBCRD/'//* SLOAN JOB BATCH= TIME='/

C SYSTEM KEYSC A$DEC=1 /* DECIMAL */C A$ABS=1 /* ABSOLUTE POSITION */

CALL ATTACH('TEMP ',4,FUNIT)CALL TRNC$A(FUNIT)CALL CLOS$A(FUNIT)PTR=0

C FIRST CHECK TO SEE IF ANY JOB IN THAT SPECIFIC JOB FILETSTBUF (1)='JO'TSTBUF (2)='B='TSTBUF (3) =ICONV (JOB VAL)DO 5 1=4,8TSTBUF(I)='

5 CONTINUE

10 CALL ATTACH('INFO ',4,FUNIT)UNIT=FUNIT+4CALL POSN$A(A$ABSFUNITPTR)READ(UNITllEND=40) INBUFF

ll FORMAT(40A2)CALL RPOS$A(FUNITPTR)

CALL CLOS$A(FUNIT)CALL COMPAR(TSTBUF,1,INBUFF,1,6,LGCODE)IF (LGCODE) GO TO 30

20 CALL ATTACH('TEMP ',4,FUNIT)CALL APPEND(INBUFFFUNIT)CALL CLOS$A(FUNIT)GO TO 10

30 INPUT=INBUFF (13)CALL CNVA$A(A$DECINPUT,2,VALUE)IVALUE=VALUEIF (IVALUE.EQ.0) GO TO 100

C RESET THE NUMBER INPUT TO ZERO, SO WILL BE CLEARED BEFOREC NEXT BATCH

INBUFF(13)='00'GO TO 20

40 CALL CLOS$A(FUNIT)CALL DELE$A('INFO',4)CALL CNAM$$('TEMP',4,'INFO',4,CODE)

C APPEND DELIMITER TO END OF BATCHCALL ATTACH('INFO ',4,FUNIT)CALL READTL('DELIM= ',6,INBUFFLGCODEFUNIT)CALL CLOS$A(FUNIT)BUFFER (1) =INBUFF (4)

DO 50 1=2,40BUFFER(I)=''

50 CONTINUE

55 JOBFIL(1)='JO'JOBFIL (2)='BN'JOBFIL (3)=ICONV(JOBVAL)CALL ATTACH(JOBFIL,6,FUNIT)CALL APPEND(BUFFERFUNIT)

C APPEND COMMENT TO END OF BATCH

DO 60 I=1,15BUFFER(I)=JOBCRD(I)

60 CONTINUEDO 61 I=16,40BUFFER(I)='

61 CONTINUEBUFFER (12)=ICONV(JOBVAL)CALL TIME$A(TIME)DO 62 I=1,4BUFFER(I+15)=TIME (I)

62 CONTINUECALL DATE$A(DATE)DO 63 I=1,8BUFFER(I+21)=DATE(I)

63 CONTINUE

CALL APPEND(BUFFERFUNIT)CALL CLOS$A(FUNIT)

CALL ATTACH('LOGFIL',6,FUNIT)CALL APPEND(BUFFERFUNIT)CALL CLOS$A(FUNIT)

DO 65 I=1,40BUFFER(I)='

65 CONTINUE

CALL ATTACH('CMDFIL',6,FUNIT)

BUFFER (1)='HA'BUFFER (2)='SP'CALL APPEND(BUFFERFUNIT)

BUFFER (1)='TO'BUFFER(2)=' I'BUFFER(3)='BM'

CALL APPEND(BUFFERFUNIT)

DO 70 I=1,11BUFFER (I) =TEMPLA (I)

70 CONTINUE

BUFFER (12) ='JC'.BUFFER (13)='LP'BUFFER(14)=ICONV(JOBVAL)

CALL APPEND(BUFFERFUNIT)

BUFFER (12) = 'JO'BUFFER(13)='BN'.

CALL APPEND(BUFFERFUNIT)

DO 80 I=1,40BUFFER(I)='

80 CONTINUE

BUFFER(1)='EO'BUFFER(2)='S '

CALL APPEND(BUFFERFUNIT)

BUFFER(1)='QU'BUFFER(2)='IT'CALL APPEND(BUFFERFUNIT)

COMFLG=.TRUE.

99

CALL CLOS$A(FUNIT)RETURN

100 CALL DELE$A('TEMP',4)RETURNEND

100

SUBROUTINE RUNJOB (JOBVAL)

C2 RUNJOB- FIRST CHECK NUMBER OF JOBS INPUT FOR JOB SPECIFIEDC BY INPUT JOBVAL, IF EQUALS ZERO THEN RETURN, ELSEC RESET NUMBER INPUT TO ZERO, AND ADD 2780 COMMANDS TOC COMMAND FILE TO RUN THE BATCH, AND SET THE COMMANDC - FILE FLAG.

C ADDS COMMANDS TO COMMAND FILEC SETS COMMAND FILE INPUT FLAGC CHANGES THE FILE TAINP>CRSFIL>INFO

C JOBVAL= THE IDENTIFYING NUMBER FOR THE JOB TO BE RUN

C INSERT SYSTEM KEYSSINSERT SYSCOM>ASKEYS

C INPUT PARAMETERSINTEGER JOBVAL

C DECLARATION OF VARIABLESINTEGER BUFFER(40),TEMPLA(11),DELIM,FUNITUNIT,

+TSTBUF(40),INBUFF(40),INPUT,I,JOBFIL(3),IVALUE,+CODE,TIME(4),DATE(8),JOBCRD(15),RJEl(14),RJE2(15),RJE3(15)INTEGER*4 VALUEPTRLOGICAL COMFLGLGCODE

COMMON/MAIN/COMFLGDATA JOBCRD/'//* SLOAN JOB BATCH= TIME='/DATA RJEl/'CONCAT RJE FILE JCLP JOBN'/DATA RJE2/'RJSEND RJE FILE IBMDATA RJE3/'DELETE RJEFILE '/

C SYSTEM KEYSC A$DEC=1 /* DECIMAL */C ASABS=1 /* ABSOLUTE POSITION */

CALL ATTACH('TEMP ',4,FUNIT)CALL TRNC$A(FUNIT)CALL CLOS$A (FUNIT)PTR=0

C FIRST CHECK TO SEE IF ANY JOB IN THAT SPECIFIC JOB FILETSTBUF (1)='JO'TSTBUF (2)='B='TSTBUF (3)=ICONV (JOBVAL)DO 5 I=4,8TSTBUF(I)='

5 CONTINUE

10 CALL ATTACH('INFO ',4,FUNIT)UNIT=FUNIT+4CALL POSN$A(ASABSFUNITPTR)READ(UNITllEND=40) INBUFF

101

l1 FORMAT(40A2)CALL RPOS$A(FUNIT,PTR)CALL CLOS$A(FUNIT)CALL COMPAR(TSTBUF,1,INBUFF,1,6,LGCODE)IF (LGCODE) GO TO 30

20 CALL ATTACH('TEMP ',4,FUNIT)GALL APPEND(INBUFFFUNIT)CALL CLOS$A(FUNIT)GO TO 10

30 INPUT=INBUFF(13)CALL CNVA$A(A$DEC,INPUT,2,VALUE)IVALUE=VALUEIF (IVALUE.EQ.0) GO TO 100

C RESET THE NUMBER INPUT TO ZERO, SO WILL BE CLEARED BEFOREC NEXT BATCH

INBUFF (13)='00'GO TO 20

40 CALL CLOS$A(FUNIT)CALL DELE$A('INFO',4)CALL CNAM$$('TEMP',4,'INFO',4,CODE)

C APPEND DELIMITER TO END OF BATCHCALL ATTACH('INFO ',4,FUNIT)CALL READTL('DELIM= ',6,INBUFF,LGCODEFUNIT)CALL CLOS$A(FUNIT)BUFFER(1)=INBUFF(4)

DO 50 1=2,40BUFFER(I)='

50 CONTINUE

55 JOBFIL(1)='JO'JOBFIL (2)='BN'JOBFIL (3) =ICONVIJOBVAL)CALL ATTACH(JOBFIL,6,FUNIT)CALL APPEND(BUFFERFUNIT)

C APPEND COMMENT TO END OF BATCH

DO 60 I=1,15BUFFER(I)=JOBCRD(I)

60 CONTINUEDO 61 I=16,40BUFFER(I)='

61 CONTINUEBUFFER (12) =ICONV (JOBVAL)CALL TIMESA(TIME)DO 62 I=1,4BUFFER(I+15)=TIME(I)

62 CONTINUECALL DATE$A(DATE)DO 63 I=1,8BUFFER(I+21)=DATE(I)

102

63 CONTINUE

CALL APPEND(BUFFER,FUNIT)CALL CLOS$A (FUNIT)

CALL ATTACH('LOGFIL',6,FUNIT)CALL APPEND(BUFFER,FUNIT)CALL CLOS$A(FUNIT)

DO 65 I=1,40BUFFER(I)='

65 CONTINUE

CALL ATTACH('CMDFIL',6,FUNIT)DO 70 1=1,14BUFFER(I)=RJE1(I)

70 CONTINUEBUFFER(11)=ICONV(JOBVAL)BUFFER (15) =ICONV (JOBVAL)

CALL APPEND(BUFFER,FUNIT)

DO 71 I=1,15BUFFER (I) =RJE2 (I)

71 CONTINUECALL APPEND(BUFFERFUNIT)

DO 72 1=1,15BUFFER (I) =RJE3 (I)

72 CONTINUECALL APPEND (BUFFERFUNIT)CALL CLOS$A(FUNIT)

COMFLG=. TRUE.CALL CLOS$A(FUNIT)RETURN

100 CALL DELE$A('TEMP',4)RETURNEND

103

SUBROUTINE BANNER(TYPE)C BANNER- PRINTS OUT ON THE COMMAND CONSOLE A BANNER,C USED TO IDENTIFY THE ERROR MESSAGE THAT FOLLOWS IT.C THE INPUT TYPE SPECIFIES WHICH MESSAGE TO PRINT.

C TYPE= 1, STUDENT ERRORC ~ 2, STUDENT WARNINGC 3, TA ERRORC 4, SYSTEM PROG ERRORC 5, STUDENT JOB INPUTC 6, COMMAND FILE EXECUTINGC 7, ACKNOWLEDGE TA COMMAND

C INPUT VARIABLESINTEGER TYPE

C DECLARATION OF VARIABLESINTEGER STARS(18),STDMSG(18),WRNMSG(18),TAMSG(18),

+SYSMSG(18),INPMSG(18),CMDMSG(18),TACMD(18)

DATA STARS/'*----------------------------------*'/DATA STDMSG/'* STUDENT DECK INPUT ERROR *'/

DATA WRNMSG/'* STUDENT DECK WARNING *'/

DATA TAMSG/'* USER DECK INPUT ERRORDATA SYSMSG/'* SYSTEM PROG ERROR *'/

DATA INPMSG/'* STUDENT JOB INPUT *'/

DATA CMDMSG/'* PHANTOM TA COMMAND FILEDATA TACMD/'* USER COMMAND EXECUTED *'/

CALL TNOU(STARS,36)IF (TYPE.EQ.1) CALL TNOU(STDMSG,36)IF (TYPE.EQ.2) CALL TNOU(WRNMSG,36)IF (TYPE.EQ.3) CALL TNOU(TAMSG,36)IF (TYPE.EQ.4) CALL TNOU(SYSMSG,36)IF (TYPE.EQ.5) CALL TNOU(INPMSG,36)IF (TYPE.EQ.6) CALL TNOU(CMDMSG,36)IF (TYPE.EQ.7) CALL TNOU(TACMD,36)CALL TNOU(STARS,36)

RETURNEND

104

SUBROUTINE NMCRMP(NAMECRSMPTYPE)

C NMCRMP- THIS ROUTINE OUTPUTS TO THE COMMAND CONSOLE IN AC READABLE FORMAT THE INPUTS: NAME,CRS,AND MP.C IF TYPE=3, TA ERROR, THEN THE MP IS NOT PRINTED

C INPUT PARAMETERSINTEGER NAME(8),CRS(3),MPTYPE

C DECLARATION OF VARIABLESINTEGER BUFFER(21),TEMPLA(21),LENGTHFIRST,I

DATA TEMPLA/'NAME= CRS= MP= '7

LENGTH=20IF (TYPE.EQ.3) LENGTH=15

DO 10 I=l,LENGTHBUFFER(I)=TEMPLA(I)

10 CONTINUE

FIRST=LENGTH+1DO 15 I=FIRST,21BUFFER(I)='

15 CONTINUE

DO 20 I=1,8BUFFER (1+3) =NAME (I)

20 CONTINUE

DO 30 I=1,3BUFFER (I+14)=CRS (I)

30 CONTINUE

IF(TYPE.EQ.3) GO TO 40BUFFER (21) =MP

40 CALL TNOU(BUFFER,42)

RETURNEND

105

SUBROUTINE SRCH01(CRSMPNUM,JOBST,CRSVALDELIM)

C SRCH01 THIS ROUTINE SEARCHES THE FILE TAINP>CRSFIL>INFO FORC INFORMATION USED BY THE JOBINP MODULEC FROM THE INPUT OF THE COURSE NAME, IT RETURNS THEC INTEGER VALUE IDENTIFYING THE COURSE, THE NUMBER-C - OF MACHINE PROBLEMS, THE JOB VALUE FOR THE FIRSTC MACHINE PROBLEM, AND THE CONTROL DELIMITER.

C CRS= COURSE NAMEC MPNUM= NUMBER OF MACHINE PROBLEMSC JOBST= THE JOB VALUE FOR THE FIRST MACHINE PROBLEM OFC THIS COURSEC CRSVAL= INTEGER VALUE IDENTIFYING THIS COURSEC DELIM= THE CONTROL DELIMITER USED. THE JOBINP MODULEC CHECKS THE FIRST COLUMN OF STUDENT INPUT CARDSC FOR THIS DELIMITER. DEFAULT='??'

C INSERT SYSTEM KEYS$INSERT SYSCOM>A$KEYS

C INPUT PARAMETERSINTEGER CRS(3)

C OUTPUT PARAMETERSINTEGER MPNUMJOBSTCRSVALDELIM

C DECLARATION OF VARIABLESINTEGER INBUFF(40),OUTBUF(40),INDELFUNIT,+CMDBUF(15),BUFF1(40),BUFF2(40),ICRSNAM(8)LOGICAL LGTEMPLGCODEINTEGER*4 VALUE

DATA CMDBUF/'CRS 'MPNUM ','JOBST ','CRSVL ',+1 '/

C SYSTEM KEYSC A$DEC=1 /* DECIMAL */

CRSNAM (1)='CR'CRSNAM (2)='S='DO 1 I=3,5CRSNAM (I)=CRS (1-2)

1 CONTINUEDO 2 I=6,8CRSNAM(I)='

2 CONTINUECALL ATTACH('INFO ',4,FUNIT)CALL READTL(CRSNAM,10,INBUFF,LGCODEFUNIT)IF (.NOT.LGCODE) RETURN

CALL PARSE(INBUFFOUTBUF,4,CMDBUF,1,4)

106

MPNUM=OUTBUF (9)JOBST=OUTBUF (17)CRSVAL=OUTBUF (25)

CALL CNVA$A(A$DECMPNUM,2,VALUE)MPNUM=VALUE

CALL CNVA$A (A$DEC, JOBST, 2,VALUE)JOBST=VALUE

CALL CNVA$A (A$DECtCRSVAL, 2,VALUE)CRSVAL=VALUE

CALL READTL('DELIM= ',6,INBUFFLGCODE,FUNIT)

60 INDEL=INBUFF(4)IF (INDEL.EQ.' ') GO TO 90DELIM=INDELGO TO 100

90 DELIM='??'

100 CALL CLOS$A(FUNIT)RETURNEND

107

SUBROUTINE SRCH02(NAMECRSVALMPVALNRUNLIMITNAMFLG)C SRCH02-- THIS ROUTINE SEARCHES THE FILE TAINP>CRSFIL>C CRSN## FOR INFORMATION USED BY JOBINP MODULEC NAME= STUDENT NAMEC CRSVAL= IDENTIFYING NUMBER FOR COURSEC MPVAL= NUMBER OF MACHINE PROBLEMC NRUN= NUMBER OF RUNS ALREADY MADEC LIMIT= MAXIMUM NUMBER OF RUNS ALLOWEDC NAMFLG= TRUE, IF NAME FOUNDC FALSE, IF NAME NOT FOUND

C INSERT SYSTEM KEYS$INSERT SYSCOM>A$KEYS

C INPUT PARAMETERSINTEGER NAME(8) ,CRSVALMPVAL

C OUTPUT PARAMETERSINTEGER NRUNLIMITCRSFIL(3)LOGICAL NAMFLG

C DECLARATION OF VARIABLESINTEGER INBUFF(40),FUNITINDEX,IINTEGER*4 VALUELOGICAL LGCODE

C SYSTEM KEYSC A$DEC=1 /* DECIMAL */

CRSFIL(1)='CR'CRSFIL (2)='SN'CRSFIL (3) =ICONV (CRSVAL)CALL ATTACH(CRSFIL,6,FUNIT)

CALL READTL('LIMITS ',6,INBUFFLGCODEFUNIT)

10 INDEX=8+4*MPVALLIMIT=INBUFF (INDEX)

CALL CNVA$A(A$DECLIMIT,2,VALUE)LIMIT=VALUE

CALL READTL(NAME,16,INBUFFLGCODEFUNIT)IF (LGCODE) GO TO 30GO TO 90

30 NAMFLG=.TRUE.CALL CNVA$A(A$DEC,INBUFF(INDEX),2,VALUE)NRUN=VALUEGO TO 100

90 NAMFLG=.FALSE.

108

100 CALL CLOS$A(FUNIT)RETURNEND

109

SUBROUTINE SRCH03(NAMECRSPASSWDPASFLG)C SRCH03- SEARCH THE FILE TAINP>CRSFIL>INFO FOR INFORMATIONC USED BY THE TAINP MODULEC THIS ROUTINE COMPARES THE INPUTS: NAME,CRS,ANDPASSWD,C TO THOSE ARE PRESENT IN THE DATA BASE FOR THE TA'S.C IF ALL THE INFORMATION MATCHES UP THE PASFLG IS SETC ~ TO TRUE.

C NAME=TA NAMEC CRS= COURSE NAMEC PASSWD= PASSWORDC PASFLG= PASS FLAG, SET TO TRUE IF NAME,CRS,AND PASSWORDC ARE ACCEPTABLE FOR TA INPUT

C INPUT PARAMETERSINTEGER NAME(8),CRS(3),PASSWD(3)

C DECLARATION OF VARIABLESINTEGER INBUFF(40),OUTBUF(40),TANAM(8),CODEFUNITRNW,+INPASS(3),INCRS(3),CMDBUF(15),IK,BUFFl(40),UNIT

LOGICAL PASFLGLGCODE

DATA CMDBUF/'TANAM ','CRS ','PASSW ',' '/

CALL ATTACH('INFO ',4,-FUNIT)UNIT=FUNIT+4CALL READTL('TANAM= ',6,INBUFF,LGCODEFUNIT)

10 CALL PARSE(INBUFFOUTBUF,2,CMDBUF,1,3)

DO 15 I=1,8BUFFl (I) =NAME (I)

15 CONTINUEDO 16 I=9,40BUFF1(I)='

16 CONTINUE

CALL COMPAR(BUFF1,1,OUTBUF,1,16,LGCODE)IF (LGCODE) GO TO 19GO TO 100

19 DO 20 I=1,3BUFFl (I) =CRS (I)

20 CONTINUEDO 21 I=4,40BUFF1(I)='

21 CONTINUE

CALL COMPAR(BUFF1,1,OUTBUF,9,6,LGCODE)IF (LGCODE) GO TO 35GO TO 100

110

35 DO 40 I=1,3BUFFl(I)=PASSWD(I)

40 CONTINUEDO 41 I=4,40BUFFl(I)='

41 GONTINUE

PASFLG=. TRUE.CALL COMPAR(BUFFl,1,OUTBUF,17,6,LGCODE)IF (LGCODE) GO TO 300PASFLG=. FALSE.

100 READ(UNITl01,END=200) INBUFF101 FORMAT(40A2)

GO TO 10

200 PASFLG=.FALSE.

300 CALL CLOS$A(FUNIT)RETURNEND

111

SUBROUTINE NMWAIV(STDCRSMPRESULT)

C NMWAIV- RETURN THE WAIVER VALUE FOR THE JOB SPECIFIEDC BY THE INPUTS: STD,CRS,AND MP. IF NO WAIVERC HAS BEEN INPUT FOR THIS JOB, THEN ZERO IS THEC VALUE RETURNED.

C STD= STUDENT NAMEC CRS= COURSE NAMEC MP= MACHINE PROBLEM

C INSERT SYSTEM KEYS$INSERT SYSCOM>A$KEYS

C INPUT PARAMETERSINTEGER STD(8),CRS(3),MP,I

C DECLARATION OF VARIABLESINTEGER TEST(8),INBUFF(40),BUFF1(40),FUNIT,

+NUM(2) ,RESULTLOGICAL LGCODEINTEGER*4 VALUE,VAL2

C SYSTEM KEYSC A$DEC=1 /* DECIMAL */

TEST(1)='ST'TEST(2)='D='

DO 10 I=1,6TEST(I+2)=STD(I)

10 CONTINUE

CALL ATTACH('INFO ',4,FUNIT)

20 DO 30 I=1,40INBUFF(I)='

30 CONTINUE

CALL READTL(TEST,16,INBUFFLGCODEFUNIT)

C IF END OF FILE, WAIVER=0IF (.NOT.LGCODE) GO TO 200

DO 31 I=1,8BUFFl (I) =STD (I)

31 CONTINUEDO 32 I=9,40BUFF1(I)='

32 CONTINUECALL COMPAR(INBUFF,3,BUFFl,1,16,LGCODE)IF (LGCODE) GO TO 34GO TO 100

112

34 DO 35 I=1,3BUFFl (I) =CRS (I)

35 CONTINUEDO 36 I=4,40BUFFl(I)='

36 CONTINUE

CALL COMPAR(INBUFF,14,BUFF1,1,6,LGCODE)IF (LGCODE) GO TO 40GO TO 100

40 CALL CNVA$A(A$DECINBUFF(20),2,VALUE)CALL CNVA$A(A$DEC,MP,2,VAL2)IF (VALUE.EQ.VAL2) GO TO 50GO TO 100

50 NUM(1)=INBUFF(24)NUM (2)=INBUFF (25)

CALL CNVA$A (A$DEC , NUM, 4, VALUE)RESULT=VALUEGO TO 200

100 RESULT=0GO TO 20

200 CALL CLOS$A (FUNIT)RETURNEND

113

SUBROUTINE PARSE(INBUFFOUTBUF,NUMCMDCMDBUFSTARTCODE)

C PARSE- IS A A ROUTINE TO PARSE A COMMAND LINE OF THE

C FOLLOWING FORMAT:C INBUFF=C CMDl=AAA CMD2=BBB CMD3=CCC CMD4=DDD CMD5=EEE

C OUTB UF (I -8 ) =AAAC OUTBUF(9-16)=BBBC OUTBUF(17-24)=CCCC OUTBUF(25-32)=DDDC OUTBUF(33-40)=EEE

C EACH COMMAND IS UP TO 6 CHARACTERS LONG

C (I.E. CMD###=,WAIVER=)EACH PARAMETER IS UP TO 16 CHARACTERS LONG

C (I.E. AAAAAAAAAAAAAAAA)

C ERROR MESSAGES WILL BE PRINTED IF A COMMAND IS REPEATED,C OR A BAD COMMAND IS USED

C INBUFF=INPUT BUFFERC OUTBUF=OUTPUT BUFFERC NUMCMD=NUMBER OF COMMANDSC CMDBUF=BUFFER THAT CONTAINS COMMANDS TO LOOK FOR,

C EACH COMMAND=6 CHARACTERS/3 WORDSC START=PLACE IN INBUFF TO START PROCESSING

C CODE= ERROR CODE, TO OUTPUT CORRECT ERROR MESSAGE BANNER

C INPUT PARAMETERSINTEGER INBUFF(40),CMDBUF(15),NUMCMDSTARTCODE

C OUTPUT PARAMETERSINTEGER OUTBUF (40)

C DECLARATION OF VARIABLESINTEGER BUFF(80),TBUFF2(8),TBUFF1(3),AEQASPACOCMD,I,J,K

LOGICAL BADKEYREPERRONEFLGTWOFLG,THDFLGFORFLGFIVFLG,+NAMEQV

BADKEY=.FALSE.REPERR=.FALSE.ONEFLG=.FALSE.TWOFLG=. FALSE.THDFLG=.FALSE.FORFLG=.FALSE.FIVFLG=.FALSE.

AEQ=LT('= ',8)ASP=LT(' ',8)ACO=LT(', ',8)

J=START

114

DO 20 I=1,40BUFF(2*I-1)=LT(INBUFF(I),8)BUFF(2*I)=LS(INBUFF(I) ,8)

20 CONTINUE

DO 30 I=1,40dUTBUF(I)='

30 CONTINUE

31 DO 40 I=J,80IF (BUFF(I).NE.ASP.AND.BUFF(I).NE.ACO)

40 CONTINUE

C END OF COMMAND LINEGO TO 1000

41 J=I

GO TO 41

DO 50 I=1,3TBUFF1(I)='

50 CONTINUE

C PARSE COMMANDDO 60 I=1,3TBUFF1(I)=LT(BUFF(J),8)+RS(TBUFF1(I),8)J=J+1IF (BUFF(J).EQ.ASP.OR.BUFF(J).EQ.AEQ) GO TO 70TBUFF1(I)=LT(TBUFFl(I),8)+RS(BUFF(J),8)J=J+1IF (BUFF(J).EQ.ASP.OR.BUFF(J).EQ.AEQ) GO TO 70

60 CONTINUE

65 J=J+1IF (BUFF(J).NE.AEQ.AND.BUFF(J)..NE.ASP) GO TO 65

70 J=J+1IF (BUFF (J) .EQ.AEQ)

C END PARSE COMMANDK=1

GO TO 70

C LOOK FOR COMMANDDO 80 1=1,8IF (NAMEQV(TBUFF1,CMDBUF(K)))K=K+3

80 CONTINUE

GO TO (100,110,120,130,140),I

BADKEY=.TRUE.GO-TO 31

C DEPENDING ON COMMAND SET OUTPUT ARRAY VALUE100 CMD=0

IF (ONEFLG) REPERR=.TRUE.ONEFLG=.TRUE.

115

GO TO 200

110 CMD=8IF (TWOFLG) REPERR=.TRUE.TWOFLG=.TRUE.GO TO 200

120 CMD=16IF (THDFLG) REPERR=.TRUE.THDFLG=. TRUE.GO TO 200

130 CMD=24IF (FORFLG) REPERR=.TRUE.FORFLG=. TRUE.GO TO 200

140 CMD=32IF (FIVFLG) REPERR=.TRUE.FIVFLG=.TRUE.GO TO 200

200 DO 210 K=1,8TBUFF2(K)='

210 CONTINUE

C PARSE PARAMETERDO 220 K=1,8TBUFF2(K)=LT(BUFF(J),8)+RS(TBUFF2(K),8)J=J+1IF (BUFF(J).EQ.ASP.OR.BUFF(J).EQ.ACO) GO TO 300TBUFF2 (K)=LT (TBUFF2 (K) , 8)+RS (BUFF (J) ,8)

J=J+1IF (BUFF(J).EQ.ASP.OR.BUFF(J).EQ.ACO) GO TO 300

220 CONTINUE

221 J=J+1IF (BUFF(J).NE.ASP.AND.BUFF(J).NE.ACO) GO TO 300GO TO 221

C END PARSE PARAMETERC PUT PARAMETER IN OUTPUT ARRAY

300 DO 310 I=1,8K=I+CMDOUTBUF(K)=TBUFF2 (I)

310 CONTINUE

GO TO 31

1000 IF (.NOT.REPERR) GO TO 1010CALL BANNER(CODE)CALL TNOU('REPEATED KEYWORD',16)CALL TNOUA('CARD=',5)CALL TNOU(INBUFF,80)

116

CALL TNOU(' ',1)

1010 IF (.NOT.BADKEY) GO TO 1020CALL BANNER(CODE)CALL TNOU('BAD KEYWORD',ll)CALL TNOUA('CARD=',5)CALL TNOU(INBUFF,80)CALL TNOU(' ',)

1020 RETURNEND

117

SUBROUTINE COMPAR(BUFFl,STlBUFF2,ST2,CHARLGCODE)

C COMPAR- A LOGICAL FUNCTION TO COMPARE TWO SEPARATE

C BUFFERS FOR EQUALITY, EQUALS TRUE IF MATCH,

C FALSE IF NO MATCH.

C BIJFF1= FIRST BUFFER TO BE COMPAREDC ST1= PLACE IN FIRST BUFFER TO START COMPARING FROM

C BUFF2= SECOND BUFFER TO BE COMPAREDC ST2= PLACE IN SECOND BUFFER TO START COMPARING FROM

C CHARS= NUMBER OF CHARACTERS TO COMPARE

C INPUT PARAMETERSINTEGER BUFF1(40),BUFF2(40),STlST2,CHARLOGICAL LGCODE

C DECLARATION OF VARIABLESINTEGER LENGTH, LAST, I

LENGTH=CHAR/2LGCODE=.TRUE.

LAST=LENGTH-1DO 10 I=0,LASTIF (BUFF1(ST1+I).NE.BUFF2(ST2+I)) LGCODE=.FALSE.

10 CONTINUE

RETURNEND

118

SUBROUTINE CHCKMP(CRSMPCRSVAL,MPVAL,JOBVAL,CODE)

C CHCKMP- THIS ROUTINE CHECKS TO SEE IF THE MP SPECIFIEDC IS A POSSIBLE VALUE FOR THAT COURSE, IF IT IS NOTC A PROPER VALUE AN ERROR MESSAGE WILL BE PRINTED.

C CRS= COURSE NAMEC MP= MACHINE PROBLEM NAME, ASCIIC CODE= ERROR CODE, TELLS ROUTINE WHICH TYPE OF ERROR BANNERC TO PRINTC CRSVAL=IDENTIFYING COURSE VALUEC MPVAL= MACHINE PROBLEM NUMBERC JOBVAL= IDENTIFYING JOB VALUE FOR THIS MACHINE PROBLEM

C INSERT SYSTEM KEYS$INSERT SYSCOM>A$KEYS

C INPUT PARAMETERSINTEGER CRS (3) ,MPCODE

C DECLARATION OF VARIABLESINTEGER MPVALCRSVALJOBVALMPNUMJOBSTDELIMINTEGER*4 VALUE

C SYSTEM KEYSC A$DEC=l /* DECIMAL */

CALL SRCH01(CRS,-MPNUMJOBSTCRSVALDELIM)

CALL CNVA$A(A$DECMP,2,VALUE)IF (VALUE.LE.MPNUM.AND.VALUE.GE.1) GO TO 10

CALL BANNER(CODE)CALL TNOU('INVALID MACHINE PROBLEM SPECIFIED',33)CALL TNOU(' ',11

MPVAL=0GO TO 100

10 MPVAL=VALUEJOBVAL=JOBST+MPVAL-1

100 RETURNEND

119

FUNCTION ICONV (VALUE)

C INPUT PARAMETERINTEGER VALUE

C DECLARATION OF VARIABLESINTEGER NUMBUF (99)

DATA NUMBUF/'010203040506070809101112131415161718192021',+'222324252627282930313233343536373839404142434445464748',+'495051525354555657585960616263646566676869707172737475',+'767778798081828384858687888990919293949596979899'/

IF (VALUE.LT.1.OR.VALUE.GT.99) GO TO 10ICONV=NUMBUF(VALUE)RETURN

10 CALL BANNER(4)CALL TNOU('BAD ARGUMENT TO ICONV',21)IF (VALUE.LT.1) ICONV='00'IF (VALUE.GT.99) ICONV='99'RETURNEND

120

SUBROUTINE ATTACH(NAMELENGTHFUNIT)

C ATTACH- ATTACH TO AlDENKER>CRSFIL>NAMEC AND OPEN FILE FOR READING AND WRITING

C NAME=FILE NAMEC rENGTH=LENGTH OF NAME IN CHARACTERSC FUNIT=FILE UNIT FILE OPENED ON

C INSERT SYSTEM KEYS$INSERT SYSCOM>A$KEYS$INSERT SYSCOM>KEYS.F

C DECLARATION OF VARIABLESINTEGER FUNIT,CODENAME(3),LENGTH,ILOGICAL LGTEMP,OPEN$A

SYSTEM KEYSK$IMFD=:0K$SETH=:1K$ICUR=:2K$CURR=:177777A$SAMF=0A$RDWR=3

/* UFD IS IN MFD *//* SET HOME UFD *//* UFD IS IN CURRENT UFD *7/* SEARCH MFD OF CURRENT DISK *//* OPEN NEW SAM FILE *//* READ\WRITE */

CALL ATCH$$('MFD',3,K$ALLD,'PART2',K$IMFD+K$SETHCODE)

CALLATCHS$('AIDENKER',8,K$ALLD,'NTRUMP',K$IMFD+K$SETHCODE)

IF (CODE.EQ.0) GO TO 10CALL BANNER(4)CALL TNOU('CANT ATTACH TO AlDENKER',23)RETURN

10 CALL ATCH$$('CRSFIL',6,K$CURR,'IF (CODE.EQ.0) GO TO 20CALL BANNER(4)CALL TNOU('CANT ATTACH TO CRSFIL',2l)RETURN

,K$ICURCODE)

20 DO 30 I=2,15FUNIT=ICALL CLOS$A(FUNIT)LGTEMP=OPEN$A(A$RDWR+A$SAMF,NAME,LENGTHFUNIT)IF (LGTEMP) GO TO 40

30 CONTINUECALL BANNER(4)CALL TNOUA('CANT OPEN ',10)CALL TNOU(NAMELENGTH)

40 RETURNEND

121

SUBROUTINE HRPORT (TIME)

C HRPORT- ADD THE HOURLY REPORT TO THE FILEC AlDENKER>CRSFIL>REPORT. IF FIRST REPORT OFC DAY THE FILE IS CLEARED FIRST. ALSO THE HOURC OF THE IS RESET

C TIME=TIME OF REPORT, INTEGER

C INSERT SYSTEM KEYS$INSERT SYSCOM>A$KEYS

C DECLARATINO OF VARIABLESINTEGER TIMEFUNITINBUFF(40),REPORT,NUMBUF(12),TITLE(12),+COURSE(4),BUFFER(40),I,CRS1(3),MPNUM1,JOBSTlCRSVAL,CRSNUM,+LINE(13),JOBLIN(8),DELIM,J,FIRSTLAST,K,SPUNITPRTIME,+TSTBUF(40) ,CODEDATE(8)

C THE DIMENSIONS OF THESE VARIABLES ONLY ALLOW TEN COURSESINTEGER CRS(10,3),MPNUM(10),JOBST(10)

INTEGER*4 VALUEPTRLOGICAL LGCODE

C SYSTEM KEYSC A$DEC=1 /* DECIMAL */C A$ABS=1 /*ABSOLUTE POSITION */

DATA NUMBUF/' 1 2 3 4 5 6 7 8 9101112'/DATA TITLE /'HOURLY REPORT :00 '/DATA LINE /'MP input/ needed '/DATA COURSE/'COURSE: '/

CRSNUM=0

C ADD TITLE LINEDO 10 I=1,12BUFFER (I) =TITLE (I)

10 CONTINUE

DO 11 I=13,40BUFFER(I)='

11 CONTINUE

PRTIME=TIMEIF (TIME.GT.12) PRTIME=TIME-12BUFFER (9) =NUMBUF (PRTIME)BUFFER(12)='PM'IF (TIME.LE.12) BUFFER(12)='AM'CALL DATE$A(DATE).DO 12 I=1,8BUFFER (1+13) =DATE (I)

12 CONTINUECALL ATTACH('REPORT',6,FUNIT)

122

IF (TIME.EQ.10) CALL TRNC$A(FUNIT)CALL APPEND(BUFFERFUNIT)CALL CLOS$A (FUNIT)

PTR=OC READ THROUGH 'INFO' FILE AND GET COURSE INFORMATIONC AND SAVE IT IN ARRAYS

15 CALL ATTACH('INFO ',4,FUNIT)CALL POSN$A(A$ABSFUNIT,PTR)CALL READTL('CRS= ',4,INBUFFLGCODEFUNIT)CALL RPOS$A(FUNITPTR)CALL CLOS$A (FUNIT)IF (LGCODE) GO TO 20GO TO 100

20 CRSNUM=CRSNUM+1IF (CRSNUM.GT.10) GO TO 200DO 21 I=1,3CRS (CRSNUM,I)=INBUFF (1+2)CRSl (I)=INBUFF(I+2)

21 CONTINUE

CALL SRCH01 (CRS1,MPNUMlJOBST1,CRSVALDELIM)JOBST (CRSNUM) =JOBST1MPNUM (CRSNUM) =MPNUMlGO TO 15

100 JOBLIN(1)='JO'JOBLIN (2)='B='DO 101 I=3,8JOBLIN(I)=' '

101 CONTINUE

DO 190 I=1,CRSNUM

C ADD COURSE NAME -

DO 110 J=1,4BUFFER (J)=COURSE (J)

110 CONTINUE

DO 111 J=4,40BUFFER(J)='

111 CONTINUE

DO 112 J=1,3BUFFER (J+4)=CRS (I,J)

112 CONTINUE

CALL ATTACH('REPORT',6,FUNIT)CALL APPEND(BUFFER,FUNIT)CALL CLOS$A(FUNIT)

C DO MACHINE PROBLEMS THIS COURSEFIRST=JOBST(I)-1

123

LAST=MPNUM(I)DO 150 J=l,LASTCALL ATTACH('INFO ',4,FUNIT)JOBLIN (3)=ICONV (J+FIRST)CALL READTL(JOBLIN,6,INBUFFLGCODE,FUNIT)CALL CLOS$A(FUNIT)DO 120 K=1,13BUFFER(K)=LINE(K)

120 CONTINUEDO 121 K=14,40BUFFER(K)='

121 CONTINUE

K=ICONV(J)SP=' 'BUFFER(2)=LS (K,8)+RT(SP,8)BUFFER (4)=INBUFF (13)BUFFER(9)=INBUFF (8)CALL ATTACH('REPORT',6,FUNIT)CALL APPEND (BUFFER, FUNIT)CALL CLOS$A(FUNIT)

150 CONTINUE

C PUT SPACE AFTER EACH COURSEDO 151 K=1,40BUFFER(K)='

151 CONTINUECALL ATTACH('REPORT',6,FUNIT).CALL APPEND (BUFFERFUNIT)CALL CLOS$A(FUNIT)

190 CONTINUEGO TO 300

200 CALL BANNER(4)CALL TNOU('DIMENSIONS NOT LARGE ENOUGH FOR MORE THAN',41)CALL TNOU('TEN COURSES IN HRPORT SUBROUTINE',32)CALL TNOU(' ',1)CRSNUM=10GO TO 100

300 CALL PRINT('REPORT')

CHANGE REPORT VALUEINCREMENT TO NEXT HOUR

C CLEAR TEMP FILECALL ATTACH('TEMPCALL TRNC$A(FUNIT)CALL CLOS$A(FUNIT)

TSTBUFTSTBUFDO 310TSTBUF

',4,FUNIT)

(1)='RE'(2)=P='I=3,40

(I) =' '

124

310 CONTINUEPTR=0

320 CALL ATTACH('INFO ',4,FUNIT)UNIT=FUNIT+4CALL POSN$A(A$ABSFUNITPTR)READ (UNIT,330,END=400) INBUFF

330 FORMAT(40A2)CALL RPOS$A(FUNITPTR)CALL CLOS$A(FUNIT)CALL COMPAR(TSTBUF,1,INBUFF,1,4,LGCODE)IF (LGCODE) GO TO 350

340 CALL ATTACH('TEMP ',4,FUNIT)CALL APPEND(INBUFFFUNIT)CALL CLOSSA(FUNIT)GO TO 320

350 IF (TIME.EQ.18) GO TO 360CALL CNVA$A(A$DECINBUFF(3),2,VALUE)REPORT=VALUE+lINBUFF (3) =ICONV (REPORT)GO TO 340

C RESET TO 10:00 AM FOR NEXT DAY360 INBUFF(3)='10'

GO TO 340

400 CALL CLOS$A(FUNIT)CALL DELE$A('INFO',4)CALL CNAM$$('TEMP',4,'INFO',4,CODE)RETURNEND

125

SUBROUTINE LOGNAM(NAMEJOBVAL)

LC INPUT PARAMETERS

INTEGER NAME (8) ,JOBVAL

C DECLARATION OF VARIABLESINTEGER BUFFER(40),CARD(17),TIME(4),IFUNIT

DATA CARD/' BATCH= TIME='/

DO 10 I=1,17BUFFER(I)=CARD(I)

10 CONTINUEDO 15 I=18,40BUFFER(I)='

15 CONTINUEDO 20 I=1,8BUFFER(I)=NAME(I)

20 CONTINUE

BUFFER(13)=ICONV(JOBVAL)

CALL TIME$A(TIME)DO 30 I=1,4BUFFER(I+17)=TIME(I)

30 CONTINUE

CALL ATTACH('LOGFIL',6,FUNIT)CALL APPEND(BUFFER,FUNIT)CALL CLOS$A(FUNIT)RETURNEND

126

C THIS PROGRAM IS AN INTERACTIVE ROUTINE TO SET UPC THE FILES FOR THE PHANTOM TA PROGRAM

C INSERT SYSTEM KEYS$INSERT SYSCOM>A$KEYS$INSERT SYSCOM>KEYS.F

C DECLARATION OF VARIABLESINTEGER ARGlARG2,ARG3,ARG4,ARG5INTEGER CRTMPL(4),STMPLA(40),JBTMPL(13),LTMPLA(6),

+DTMPLA(3),TTMPLA(21),CTMPLA(19),CNTMPL(3)

INTEGER CRBUFF(40),STBUFF(50,40),TBUFF(40),LBUFF(40),+JBUFF(30,40),CBUFF(8,40),DBUFF(40),RETBUF(40)

INTEGER QLIM(5),QBATCH(8),QJCL(7)

INTEGER JOBNUM,CRSNAM(3),MPNUMNUMCRSINDEXBATCHLIMIT,+JCL(5),FUNITDELIM,TANAM(8),PASS(3),NAME(8),STDNUM,+INDEXCODE,I,J,K,L,N,NUMBER,NUMPLACECOURSEFIRST,+TEMPlTEMP2,LASTl,CRSFIL(3),JOBFIL(3),LAST2,LENGTH

INTEGER*4 VALUELOGICAL LGTEMP

C FILE FORMAT TEMPLATEDATA CTMPLA/'CRS=DATA CRTMPL/'COUFDATA CNTMPL/'CRSEDATA STMPLA/

+1

+'MP5=00 MP6=00DATA JBTMPL/'JOB=DATA LTMPLA/'LIMIDATA DTMPLA/'DELIDATA TTMPLA/'TANA

MPNUM= JOBST=

MP1=00 MP2=00 MP3=00MP7=00 MP8=00'/

BATCH= INPUT=00'/TS:

M='/,M= CRS=

CRSVL='/

MP4=00 ',

PASSW='/

C QUERY TEMPLATESDATA QLIM/'MPDATA QBATCH/'MPDATA QJCL/'MP

DATA RETBUF/+'CO TTY

C SYSTEM KEYSC A$FUPP=1C A$UPLW=2C A$DEC=1 /

JOBNUM=lCRSFIL(1)='CR'CRSFIL (2)='SN'

LIMIT'/BATCH SIZE

JCL FILE '/

FORCE UPPER CASE */READ UPPER AND LOWER CASEDECIMAL */

127

JOBFIL (1)='JO'JOBFIL(2)='BN'

CALL ATCH$$('MFD',3,K$ALLD,'PART2',K$IMFD+K$SETHCODE)CALL ATCH$$('AlDENKER',8,K$ALLD,'NTRUMP',K$IMFD+K$SETHCODE)CALL ATCH$$('CRSFIL',6,K$CURR,' ',K$ICUR+K$SETHCODE)

1 CALL GETFIL(NAME,LENGTH,LGTEMP)IF(.NOT.LGTEMP) GO TO 2CALL DELE$A(NAMELENGTH)GO TO 1

2 CALL ATCH$$('AIDENKER',8,K$ALLD,'NTRUMP',K$IMFD+K$SETH,CODE)CALL RNUM$A('NUMBER OF COURSES TO SET-UP',27,A$DEC,VALUE)NUMCRS=VALUE

C CREATE AND CLEAR ALL FILES TO BE SETUP

C CREATE AND CLEAR COURSE INFORMATION FILES5 DO 6 I=1,NUMCRS

CRSFIL (3) =ICONV (NUMCRS)CALL ATTACH(CRSFIL,6,FUNIT)CALL TRNC$A(FUNIT)CALL CLOS$A(FUNIT)

6 CONTINUE

C CREATE AND CLEAR COMMAND FILECALL ATTACH('CMDFIL',6,FUNIT)CALL TRNC$A (FUNIT)CALL CLOS$A (FUNIT)

C CREATE AND CLEAR INFORMATION FILECALL ATTACH('INFO ',4,FUNIT)CALL TRNC$A (FUNIT)CALL CLOS$A(FUNIT)

C CREATE AND CLEAR LOG FILECALL ATTACH('LOGFIL',6,FUNIT)CALL TRNCSA (FUNIT)CALL CLOS$A(FUNIT)

C ALL FILES CREATED AND CLEARED

DO 8 I=1,3TBUFF (I) =CNTMPL (I)

8 CONTINUETEUFF(4)=ICONV(NUMCRS)

DO 9 I=5,40TBUFF(I)='

9 CONTINUE

C ADD NUMBER OF COURSES CARD TO INFO FILECALL ATTACH('INFO ',4,FUNIT)

128

CALL APPEND(TBUFFFUNIT)CALL CLOS$A(FUNIT)

C /* PROCESS COURSE INFORMATION */DO 100 COURSE=1,NUMCRS

DO 10 J=1,19CBUFF (COURSE,J) =CTMPLA (J)

10 CONTINUE

DO 15 J=20,40CBUFF(COURSEJ)='

15 CONTINUE

CALL RNAM$A('COURSE NAME',ll,ASUPLW,CRSNAM,6)

DO 20 J=1,3K=J+2CBUFF(COURSEK)=CRSNAM(J)

20 CONTINUE

25 CALL RNUM$A('NUMBER MACHINE PROBLEMS',23,A$DECVALUE)NUMBER=VALUE

IF (NUMBER.LE.8) GO TO 26CALL TNOU('TOO MANY MACHINE PROBLEMS',25)GO TO 25

26 CBUFF(COURSE,10)=ICONV(NUMBER)CBUFF(COURSE,15)=ICONV(JOBNUM)CBUFF (COURSE, 20) =ICONV (COURSE)

INDEX=8+4 *NUMBER

DO 30 J=1,6LBUFF(J)=LTMPLA(J)

30 CONTINUE

DO 31 J=7,INDEXLBUFF (J) =STMPLA (J)

31 CONTINUE

FIRST=INDEX+1DO 32 J=FIRST,40LBUFF(J)='

32 CONTINUE

C /* PROCESS MACHINE PROBLEM INFORMATION */DO 50 K=1,NUMBER

QLIM (2)=ICONV (K)QBATCH(2)=ICONV(K)

129

QJCL (2)=ICONV (K)

CALL RNUM$A(QBATCH,16,A$DEC,VALUE)BATCH=VALUE

DO 40 J=1,13JBUFF (JOBNUM, J) =JBTMPL (J)

40 CONTINUE

DO 45 J=14,40JBUFF(JOBNUM,J)='

45 CONTINUE

JBUFF(JOBNUM, 8)=ICONV(BATCH)JBUFF(JOBNUM,3)=ICONV(JOBNUM)

CALL RNUM$A(QLIM,10,A$DECVALUE)LIMIT=VALUEPLACE=8+4*KLBUFF(PLACE)=ICONV(LIMIT)

CALL RNAMSA(QJCL,14,A$UPLWJCL,10)CALL NEWJCL(JOBNUMJCL)

JOBNUM=JOBNUM+1

50 CONTINUE /* DO NEXT MACHINE PROBLEM */

DO 55 J=1,4CRBUFF (J) =CRTMPL (J)

55 CONTINUE

DO 56 3=5,40CRBUFF(J)='

56 CONTINUE -

DO 57 L=1,3CRBUFF (L+4) =CRSNAM (L)

57 CONTINUE

C ADD COURSE NAME CARD TO CRSN## FILECRSFIL(3)=ICONV (COURSE)CALL ATTACH (CRSFIL, 6,FUNIT)CALL APPEND(CRBUFFFUNIT)

C ADD MACHINE PROBLEM LIMITS CARD TO CRSN## FILECALL APPEND (LBUFFFUNIT)

C /* PROCESS STUDENT NAMES */STDNUM=O '

60 STDNUM=STDNUM+1IF (STDNUM.EQ.51) GO TO 69CALL RNAM$A('STUDENT NAME',12,A$FUPPNAMEl6)IF (NAME(l).EQ.'. ') GO TO 69

130

DO 61 J=1,INDEXSTBUFF(STDNUMJ)=STMPLA(J)

61 CONTINUE

FIRST=INDEX+1DO 62 J=FIRST,40STBUFF(STDNUMJ)='

62 CONTINUE

DO 65 L=1,8STBUFF (STDNUML)=NAME (L)

65 CONTINUEGO TO 60 /* GO TO GET NEXT STUDENT NAME */

C SORT STUDENT NAMES69 LASTl=STDNUM-2

DO 74 J=1,LAST1FIRST=J+1LAST2=STDNUM-1DO 73 K=FIRST,LAST2DO 70 L=1,8IF (STBUFF(JL).GT.STBUFF(KL)) GO TO 71IF (STBUFF(JL).LT.STBUFF(KL)) GO TO 73

70 CONTINUECALL TNOU('NAME NOT UNIQUE',15)CALL TNOU(STBUFF(J,1),16)GO TO 73

C SWITCH PLACES71 DO 72 L=1,40

TBUFF (L) =STBUFF(J ,L)STBUFF (JL)=STBUFF (KL)STBUFF (K, L) =TBUFF (L)

72 CONTINUE -

73 CONTINUE74 CONTINUE

DO 85 J=1,LAST2DO 80 K=1,40TBUFF (K)=STBUFF(JK)

80 CONTINUECALL APPEND (TBUFFFUNIT)

85 CONTINUECALL CLOS$A(FUNIT)

100 CONTINUE /* DO NEXT- COURSE */

***********************************************************

3JOB NUM =JOB NUM -1

CALL ATTACH('INFO ',4,FUNIT)

131

TBUFF(l)='RE'TBUFF (2)='P='TBUFF(3)='l0'DO 105 I=4,40TBUFF(I)='

105 CONTINUE

C ADD TIME OF NEXT HOUR REPORT CARD TO INFO FILECALL APPEND(TBUFFFUNIT)

DO 110 I=1,COURSEDO 111 J=1,40TBUFF (J) =CBUFF (I ,J)

111 CONTINUE

C ADD COURSE INFORMATION CARD TO INFO FILECALL APPEND(TBUFFFUNIT)

110 CONTINUE

DO 120 I=1,JOBNUMDO 121 J=1,40TBUFF (J)=JBUFF(I,J)

121 CONTINUE

C ADD RUN INFORMATION CARD TO INFO FILECALL APPEND(TBUFFFUNIT)

120 CONTINUE

DO 122 J=1,3DBUFF (J) =DTMPLA (J)

122 CONTINUE

DO 123 J=4,40DBUFF(J)='

123 CONTINUE

CALL RNAM$A('DELIMITER',9,A$UPLW,DELIM,2)DBUFF(4)=DELIM

C ADD DELIMITER CARD TO INFO FILECALL APPEND(DBUFFFUNIT)

C*** 125*** /* PROCESS TA INFORMATION */125 CALL RNAM$A('TA NAME',7,A$FUPPTANAM,16)

IF (TANAM(1).EQ.'. ') GO TO 1000CALL RNAM$A('COURSE',6,A$UPLWCRSNAM,6)

CALL RNAM$A('PASSWORD',8,A$FUPPPASS,6)

DO 126 J=1,21TBUFF (J) =TTMPLA (J)

126 CONTINUE

DO 127 J= 22,40

132

TBUFF (I) =TTMPLA (I)127 CONTINUE

DO 130 1=1,8TBUFF (1+3) =TANAM (I)

130 CONTINUE

DO 140 1=1,3TBUFF (1+14) =CRSNAM (I)TBUFF (1+21) =PASS (I)

140 CONTINUE

C ADD TA INFORMATION CARD TO INFO FILECALL APPEND(TBUFFFUNIT)GO TO 125 /* GO TO GET NEXT TA */

1000 CALL CLOS$A(FUNIT)

C CREATE AND CLEAR JOB FILESDO 1005 I=1,JOBNUMJOBFIL(3)=ICONV(JOBNUM)CALL ATTACH(JOBFIL,6,FUNIT)CALL TRNC$A(FUNIT)CALL CLOS$A(FUNIT)

1005 CONTINUE

C ADD RETURN COMMAND TO COMMAND FILECALL ATTACH('CMDFIL',6,FUNIT)CALL APPEND (RETBUF, FUNIT)CALL CLOS$A(FUNIT)

C CALL COMMAND FILE TO COPY INPUT JCL FILES TO PROPERC FILES FOR PROGRAMC THE JCL FILES WILL BE CREATED WHEN THE COPY COMMAND IS EXECUTEDC FROM THE COMMAND FILE

DO 1010 FUNIT=1,15CALL COMI$$('CMDFIL',6,FUNITCODE)IF (CODE.EQ.0) GO TO 1020

1010 CONTINUE

1020 CALL EXIT

END