• Aucun résultat trouvé

OPERATOR/PROGRAM COMMUNICATION

Dans le document TEXAS INSTRUMENTS (Page 28-35)

Usage Overview'

2.7 OPERATOR/PROGRAM COMMUNICATION

You can provide Sort/Merge with the required control statements in any of the following ways (as shown in Figure 2-3):

• Through the SCI, which interprets interactive and batch commands, bids (executes) Sort/Merge, and passes control statements to Sort/Merge

• Through separate tasks that bid Sort/Merge and pass control statements to it. (The call-ing task can also send records to Sort/Merge and can receive the processed records returned from Sort/Merge. These tasks can be written in assembly language, FORTRAN, COBOL, Pascal, or BASIC.)

• By executing the Sort/Merge task and specifying the pathname of a file or physical device that contains the control statement specifications

Control statements define the Sort/Merge process; they are provided to Sort/Merge in the order in which they appear on the specification sheets shown in Figures 2-4 and 2-5. The order is as follows:

• Header Specification - Section 4

• File Description Specification - Section 5

• Record Selection Specification - Section 6

• Reformatting Specification - Section 7 2.7.1 Header Specification

This specification describes the type of sort or merge, the iength of the output records, and other program requirements (such as sequencing in ascending or descending order and whether to out-put messages during the sort or merge process).

IINTERACTIVE DEVICE

TEXT EDITOR

CARDS

(A) 1 35606A

CONTROL STATEMENTS

SYSTEM COMMAND INTERPRETER

(SCI)

SORT/MERGE

CONTROL STATEMENTS

LANGUAGE PROGRAMS

Figure 2-3. Methods of Specifying Sort/Merge Control Statements

946252-9701

BATCH INPUT

CASSETTE

2-9

Mt"!4t!

MLHGt MEHGES 50ft

OUTPUT FILE

WORK FILE

INPUT FILE

(A) 135607

SOHfA SORTR SOR TRS

L.UlW'i1 futdi ()f COlltrol

Recol(j IHyles)

SORT/MERGE SPECIFICATIONS, SHEET A Header Specification

File Description Specifications

Mt~,,\or y Work SPd""

Comments

(Columns 17 to SOl

Figure 2-4. Sort/Merge Specification, Sheet A

(CoIUf1I1!,) 40 III / ) J

Comments

(Column~ 4S to 17)

Comments

(Columns 45 10 721

1 2

Record Selection Specification Op!1rand 2 (Field or Constant

Figure 2-5. Sort/Merge Specification, Sheet B

Comments

(Columns 40 to 721

Comments

(Columns 40 to 72)

946252·9701 2-11

2.7.2 File Description Specification

This specification describes the three different files used in a sort or merge operation:

• The output fi Ie is the fi Ie that contai ns the records after they have been processed into the specified sequence and format.

• The work file is the file on which strings of sorted records are temporarily stored until the record selection process is complete. The work file is then used to combine the strings of sorted records.

• The input file(s) is the file to be sorted or merged. A merge is performed on from two to five sorted input files.

Input and output files may be sequential, relative record, or key indexed.

NOTE

Relative record files sometimes contain unused records set aside for future expansion. You should omit these unused records during the Sort/Merge process to avoid wasting disk space.

2.7.3 Record Selection Specification

The entries on this sheet describe which records in the input file(s) are to be included or omitted during the Sort/Merge process. Specific ASCII characters found in specific positions (fields) of the input file records determine the record selection. You can check fields against other fields in the same record to determine record selection, or you can compare a field to a string of constants.

Besides providing the identifying characteristics of the desired records, this specification further specifies whether the records identified are to be included in the output file.

2.7.4 Reformatting Specification

The Reformatting Specification designates which record fields are to be summed, how the input record fields are to be ordered in the output records, the sequencing of individual fields, and the characters to be forced into output record positions or substituted for other characters. It also states which fields are to be treated as signed ASCII, integer, or floating pOint.

2.7.5 Order of Specifications

You must input the four specifications to Sort/Merge in a specific order. Input the Header Specification first, followed by the File Description, Record Selection (if used), and Reformatting Specifications.

Figure 2-6 shows the typical specification sequencing for a sort. Three sets of Record Selection and Reformatting Specifications are used because each of the record types selected by the Record Selection Specifications requires different formatting for the fields within the records. If all of the records in the file are to be included in the sort, the Record Selection Specification is not necessary and you can describe the formatting using only one group of Reformatting Specifica-tions. Note that in a sort operation, only one input file, is described in the File Description Specification (that is, only one file can be sorted at a time); however, from two to five files can be merged in a merge operation.

HEADER SPECIFICATION OUTPUT FILE FILE

DESCRIPTION WORK FILE SPECI FICATION

INPUT FILE

RECORD SELECTION SPECIFICATION NO. 1 REFORMATTING SPEC I FICATION NO. 1

RECORD SELECTION SPECIFICATION NO. 2

REFORMATTING SPECIFICATION NO. 2

RECORD SELECTION SPECIF ICATION NO. 3

REFORMATTING SPECIFICATION NO. 3

(A)135609

Figure 2-6. Typical Specification Sequence for a Sort

Although a sort or merge operation has only one Header Specification and one File Description Specification, the number of Record Selection Specifications and Reformatting Specifications can vary. Record Selection Specifications and Reformatting Specifications are specified in groups unless all of the records in the file are to be sorted or merged. In the latter case, only a Reformattiing Specification is required; this is called an implied include-all sort or merge.

Figure 2·7 shows the specifications required for a typical merge procedure. Note at the bottom of the figure that different input files have their records selected by the same Record Selection Specification and corresponding Reformatting Specification. However, Input File 2 (in the center of Figure 2-7) is merged according to a selection of records specified in two different Record Selection Specifications and their accompanying Reformatting Specifications.

HEADER SPECIFICATION

FILE OUTPUT FILE

DE S CR I PT ION WORK FILE SPECIFICATION

FILE

DESCRIPTION INPUT FILE

SPECIFICATION NO. 1

RECORD SELECTION SPECIF ICATION NO. 1 REFORMATTING SPECIFICATION NO. 1

FILE

DESCRIPTION INPUT FILE NO. 2 SPECIFICATION

RECORD SELECTION SPECIFICATION NO. 2A

REFORMATTING SPECIFICATION NO. 2A

RECORD SELECTION SPECIFICATION NO. 28 REFORMATTING SPECIFICATION NO. 28

FILE

DESCRIPTION INPUT FILE NO. 3 SPECIFICATION

FILE

DESCR IPT ION INPUT FILE NO.4 SPEC IFICATION

RECORD SELECTION SPECIFICATION NO. 3.AND 4 REFORMATTING SPECIFICATION NO. 3 AND 4

(A)135610A

SAME FOR ALL INPUT FILES

INPUT FILE NO. 1 RECORD SELECTION AND REFORMATTING

INPUT FILE NO.2 RECORD SELECTION AND REFORMATTING

INPUT FILES NO.3 AND 4 RECORD SELECTION AND REFORMATTING

Figure 2-7. Typical Specification Sequence for a Merge

Dans le document TEXAS INSTRUMENTS (Page 28-35)