• Aucun résultat trouvé

BUILD CONTROL PROGRAM

Dans le document COS 300/310 (Page 156-168)

The BUILD control program is created and written on a mass storage device with editing commands.

This program conveniently falls into three sections, Field Descriptor, INPUT, and OUTPUT. Briefly, the Field Descriptor section defines all the fields to be used, the type and size and any initial values to be assigned. .

The INPUT section describes the order in which the data will be received. The input format specified in this section must be followed

Figure 6-1 is an example of a simple BUILD control program which is .0070 Tl,DlO ;TEMPORARY STORAGE .0080 Cl,D2,25 ;CONSTANT FIELD .0090 C2,D6,50000 ;CONSTAN FIELD

.0100 INPUT CDR ;INPUT FROM CARD READER

Sample BUILD Control Program

Records created according to control program in Figure 6-1 would look

6.1.1 Field Descriptor Section

The Field Descriptor section specifies all fields to be referenced in later sections of the Control program. It gives their type (alpha or decimal), size (1-510) and initial values, if any.

The format for this section is DEFINE

fieldx, typesize, initial value

where fields which contain an unsigned decimal

optionally preceded by a + or - sign or followed by

Field description statements must be entered on consecutive lines and each line is terminated with the CR key. Use the editing commands to

iSTARTS BUILD CONTROL PROGRAM iPART # FIELD, DECIMAL, 6 DIGITS iCONSTANT FIELD CONTAINING VALUE OF 500000

keyword, output format#

fieldx

keyword

(comma)

output format#

fieldx

SYS - a file on the system device

In the case of CDR, RDR and SYS, the input data is prepared in advance and stored on cards, paper tape, or the system device.

is the name assigned to a group of fields which will make up One input line to the BUILD program.

Keyword is an alphanumeric character string of any length but only the first six characters are significant. Field names cannot be keywords.

Keywords provide the connection between the data entered at BUILD run time and the data format specified in the control program.

is optional and specifies comma as the field delimiter on input lines. This allows the alphanumeric data input for that keyword to contain embedded spaces and tabs. In most cases, however, spaces are suggested as delimiters.

For example,

if control program specifies PART,

then the input line is

PART,126789,HEX BOLT,200

However, if the control program specifies PART

then the input line is

PART 126788 '#6 MACHINE SCREW' 300

is a number (1-4 for 8K systems or 1-7 for 12K systems) which specifies the output format to be used for this input line. This number corresponds to an OUTPUT section number (described in section 6.1.3). If an output format number is not specified, there is no output for fields under this keyword. If an output # is specified, no output takes place until input for the corresponding fields is completed.

is one of the previously described fields (F, T, or C) and a number. These fields must be listed

in the order in which they will be input.

To enter the BUILD input line without keywords, specify an asterisk (*) in place of a keyword. For example,

NOTE

These options may be specified for any field and have the order and format shown:

field~~~~idx'\1[flag]

[RANGE ([lfldx] ,[ufldx] )] [HASH (hfldx)] [CHECK]

l;RROR

.~

Example:

OUTPUT output format# label/default unit fie1dx

default unit is an optional entry specifying the logical unit (1-15) where the output file is located. (If the number specified exceeds 15, it is taken modulo 16.) If the file is not found on the default unit when the control program is executed, a MOUNT message is displayed.

fieldx The F, T or C fields in the order in which they are to be output.

The OUTPUT section ends with the specification of another OUTPUT section (up to 4 for 8K, 7 for 12K) or an END statement.

If another OUTPUT section is specified, its format number must be the next number in sequence. Different OUTPUT format sections can contain the same fields so that several data files can be created from one input. All fields between OUTPUT and END or OUTPUT and another OUTPUT form one record; record length must not exceed 510 characters.

OPTIONS

The OUTPUT section of the control program has two options, C or +, which are specified as follows:

OUTPUT 1 datal FlO C

T50 + T75 +C5

Use C to clear a field after output of the record. Decimal fields are cleared to zeros, alpha fields to blanks. During input the contents of fields not cleared with C options can be repeated in following records by skipping fields in subsequent input lines.

Use + as a counter or sequence check. The field to be incremented is usually a temporary field (T) and must be decimal. This field is output as part of the record being created. + increments the field by one; to increment by any other number specify an increment field (+fieldxx). The increment field (usually a C field) must be decimal and must not be larger than the destination field. If the increment sum exceeds the destination field, the high order digit is lost. The C and + options cannot be used on the same field.

Example:

0010 DEFINE 0020 Fl,D6 0030 F2,A30 0040 F3,D7 0050 F4,D6 0060 F5,D6 0070 Tl,DlO 0080 Cl,D2,25 0090 C2,D6,500000 0100 INPUT CDR 0110 PART, 0120 Fl ERROR 0130 F2

0140 F5 RANGE (Cl,C2) HASH Tl 0150 DATE

0160 F4

0170 VENDOR 1 0180 F3 CHECK

0190 OUTPUT 1 PRTFIL :OUTPUT FORMAT 1: FILE NAME, PRTFIL

0200 F3 C iVENDOR NUMBER

0210 Fl C iPART NUMBER

0220 F2 C iPART NAME

0230 F5 C iWHOLESALE PRICE

0240 F4 iDATE

0250 END

EXPLANATION

Clears fields with "C" each time record is written.

6.1.4 Storing the BUILD Control Program

When the BUILD control file is complete, it should be stored on a mass storage device for future use. Use the command

-!...WRITE BLDSPC

for example, to store the control program.

6.2 OPERATING PROCEDURES

To load the BUILD program, type

-=-RUN BUILD[, filel, ••• ,file7] [/xx]

in reply to the dot displayed by the Monitor where

filel, ••• ,file7 are the BUILD control programs. If the BUILD control file specified the INPUT device as SYS, then the rest of the files are names of data files on the system device to be input. If no files are specified, the file in the edit buffer is used to create a master file.

/xx

Multiple files are concatenated and passed to the program as one large file.

are optional switches which affect the listing printed by BUILD. The first switch is:

/L list the BUILD control program, or /N do not list the control program.

The second switch is:

/L list the data records created /N do not list the data records

If a second switch is not specified, a data records list is not produced. (/N is assumed.) If the no list condition is specified, errors encountered in the control program or data records are listed on the line printer as is the summary of hash totals, records created, etc.

Examples:

..:.. RU BUILD, BLDSPC/NL

lists the data records and summary of totals but not the control program.

~RU BUILD,BLDSPC/L

lists the control program and summary of totals, while

.!... RU BUILD, BLDSPC/LL

outputs both listings and the summary.

When BUILD is loaded, the message displayed if default messages were not specified:

MOUNT xxx xxx #02 FOR OUTPUT: omissions. Monitor displays

after each keyword to indicate it is ready for input.

6.2.2 SYS, CDR or RDR - Data Input from System Device, Card, or Papertape

If the INPUT statement specifies SYS, CDR or RDR, The question

DO YOU WISH TO EbIT ON-LINE?

is displayed. Answer NO and the CR key and future errors are printed on the line printer and all fields in the bad input line will become undefined. Records with undefined fields are not written to the output file. They remain undefined unless cleared in the output section or redefined with subsequent input.

Answer YES and the CR key to have an error message displayed on the terminal whenever an error is encountered. BUILD displays the incorrect input line, the error message and the message

RETYPE:

Type the correct input line. For details on data input refer to section 6.3. If just the CR key is typed, the field in error becomes undefined.

When BUILD reaches the end of the paper tape in the reader, it asks MORE?

---Answer NO and the CR key if there is no more input. Otherwise, put additional paper tape in the reader and type Y and the CR key to continue reading data.

When input is complete, BUILD closes the output data files and prints the number of records written and records not written and any hash totals requested and returns control to the Monitor.

When BUILD reaches the end of cards in the reader, the terminal alarm sounds. If there are more cards put them in card reader and type any key to resume operation. Otherwise type CTRL/Z to terminate input.

Dans le document COS 300/310 (Page 156-168)

Documents relatifs