Sort_Merge_Ver_5_Ref_Man_60484800D_Sep86 Sort Merge Ver 5 Ref Man 60484800D Sep86

Sort_Merge_Ver_5_Ref_Man_60484800D_Sep86 Sort_Merge_Ver_5_Ref_Man_60484800D_Sep86

User Manual: Pdf Sort_Merge_Ver_5_Ref_Man_60484800D_Sep86

Open the PDF directly: View PDF PDF.
Page Count: 108 [warning: Documents this large are best viewed by clicking the View PDF Link!]

60484800
'-"" CONTRPL DATA
SORT/MERGE
VERSION 5
REFERENCE MANUAL
CDC®OPERATING SYSTEMS:
NOS 2
NOS/BE 1
REVISION RECORD
Revision
A (11/20/81)
B (02/26/82)
C (02/20/84)
D (09/05/86)
Description
Original release under NOS/BE 1 at PSR level 552.
This manual is revised to reflect the support of NOS 2 at PSR level 552. Various
technical and editorial changes have been made. This is a complete reprint.
This manual is revised to reflect the support of NOS/BE 1.5 at PSR level 601. Various
technical and editorial changes have been made.
This manual is revised at PSR level 664 to document support of the CYBER 170 800 series
models and the CYBER 180 Computer Systems and support of overlapping keys. Various
technical and editorial changes have been made.
REVISION LETTERS I, 0, Q, AND X ARE NOT USED
©COPYRIGHT CONTROL DATA CORPORATION 1981, 1982, 1984, 1986
All Rights Reserved
Printed in the United States of America
Address comments concerning this manual to:
CONTROL DATA CORPORATION
Technology and Publications Division
P. 0. Box 3492
SUNNYVALE, CALIFORNIA 94088-3492
or use Comment Sheet in the back of this manual
ii 60484800 D
LIST OF EFFECTIVE PAGES
New features, as well as changes, deletions, and additions to information in this manual are indicated by bars
in the margins or by a dot near the page number if the entire page is affected. A bar by the page number
indicates pagination rather than content has changed.
Page Revision
Front Cover
Inside Front Cover
Title Page
ii
iii/iv
v/vi
v i i
v i i i
ix
1-1
1-2
1-3
1-4
2-1
2-2
2-3
2-4
2-5
3-1
3-2 thru 3-5
3-6
3-7
3-8 thru 3-11
4-1
4-2 thru 4-4
4-4.1/4-4.2
4-5
5-1
5-2 thru 5-7
6-1
7-1
7-2
7-3
7-4
8-1
8-2
8-3 thru 8-9
A-l thru A-13
B-l thru B-10
C-l thru C-4
D-l
D-2
E-l
E-2 thru E-5
F-l
Index-1 thru -4
Comment Sheet/Mailer
Back Cover
60484800 D i i i / i v
PREFACE
This manual describes CONTROL DAT Sort/Merge
Version 5.0, a generalized sorting and merging
utility. As described in this publication, Sort/
Merge Version 5.0 operates under control of the
NOS 2 and the NOS/BE 1 operating systems for the
CDC® CYBER 170 and CYBER 180 Computer Systems.
This manual is written for the application program
mer. You are assumed to be familiar with the CDC
operating system installed at your site and, if you
are using procedure calls to Sort/Merge, with the
calling language.
You can find related information in the publica
tions listed below; the publications are listed
within groupings that indicate relative importance
to you.
The NOS manual abstracts and the NOS/BE manual
abstracts are pocket-sized manuals containing brief
descriptions of the contents and intended audience
of all NOS and NOS product set manuals and NOS/BE
and NOS/BE product set manuals, respectively. The
manual abstracts can be useful in determining which
manuals are of greatest interest to you. The
Software P u b l i c a t i o n s Release History s e r v e s as a
guide in determining which revision level of
software documentation corresponds to the
Programming System Report (PSR) level of software
installed at your site.
0F*^
The following manuals are of primary interest:
Publication
COBOL Version 5 Reference Manual
CYBER Record Manager
Basic Access Methods Version 1.5
Reference Manual
FORTRAN Version 5 Reference Manual
SORT/MERGE Version 5 Instant
Publication
Number NOS NOS/BE 1
60497100
60495700
60481300
60484900
The following manuals are of secondary interest:
J^**\
Publication
INTERCOM Version 5 Reference Manual
Network Products
Remote Batch Facility Version 1
Reference Manual
NOS Version 2 Manual Abstracts
NOS Version 2 Reference Set, Volume 1
Introduction to Interactive Usage
NOS Version 2 Reference Set, Volume 3
System Commands
NOS/BE Version 1 Manual Abstracts
NOS/BE Version 1 Reference Manual
Software Publications Release History
Publication
Number NOS 2 NOS/BE 1
60455010
60499600
60485500
60459660
60459680
84000470
60493800
60481000
CDC manuals can be ordered from Control Data Corporation, Literature and
Distribution Services, 308 North Dale Street, St. Paul, Minnesota 55103.
This product is intended for use only as described in this
document. Control Data cannot be responsible for the proper
functioning of undescribed features or parameters.
60484800 D v / v i
CONTENTS
NOTATIONS
1. GENERAL DESCRIPTION
yims.
Functions and Features
Configuration and Software Relationships
Job Flow
2. SORT KEYS
Definition
Describing Sort Keys
Key Length and Position
Key Type
Collating Sequences
Numeric Data Formats
Sort Order
3. CONTROL STATEMENT SORTS OR MERGES
S0RT5 Control Statement
MERGE Control Statement
Directive Files
Sort/Merge Parameters
FROM
TO
KEY
DIR
L
E
EL
DIALOG
ENR
OWNF
OWNFL
OWNMRL
OWNn
RETAIN
SEQx
STATUS
SUM
VERIFY
FASTIO
Specifying Parameters by Position
FILE Control Statement
Specifying Maximum Record Length
Field Length Requirements
Listings
ix
1-1
1-1
1-2
1-2
2-1
2-1
2-1
2-1
2-1
2-2
2-2
2-5
3-1
3-1
3-1
3-1
3-2
3-2
3-2
3-2
3-3
3-3
3-4
3-4
3-4
3-4
3-4
3-5
3-5
3-5
3-5
3-5
3-7
3-8
3-9
3-9
3-9
3-10
3-11
3-11
3-11
5. PROCEDURE CALLS
SM5S0RT
SM5MERG
SM5FR0M
SM5TO
SM5KEY
SM5E
SM5EL
SM5ENR
SM5FAST
SM5N0DA
SM50FL
SM50MRL
SM50WNn
SM5RETA
SMSSEQx
SM5ST
SM5SUM
SM5END
b. COBOL INTERFACE
COBOL5 Control Statement Option
Direct Calls
7. OWNCODE ROUTINES
Specifying Owncode Routines
Owncode Routine Parameters
Owncode 1: Processing Input Records
Owncode 2: Processing Input Files
Owncode 3: Processing Output Records
Owncode 4: Processing Output Files
Owncode 5: Processing Records With
Equal Keys
8. EXAMPLES
Control Statement Sort on One Key
Sort Specification Using Interactive Dialog
Control Statement Sort on Multiple Keys
Control Statement Merge
Creating and Using a Directive File
SUM Parameter Use
A Sort Using Procedure Calls
5-1
5-1
5-2
5-2
5-2
5-2
5-3
5-3
5-3
5-4
5-4
5-4
5-4
5-4
5-4
5-5
5-5
5-6
5-7
6-1
b-1
b-1
7-1
7-1
7-1
7-2
7-3
7-3
7-4
7-4
8-1
8-1
8-1
8-3
8-3
8-4
8-4
8-7
4. INTERACTIVE USE
Terminal Access to Sort/Merge
Logging in Under NOS
Logging in Under NOS/BE
In t era c ti v e D ial o g
Interactive Commands
HELP
RESTART
QUIT
Specifying Parameters Interactively
Logging Out
4-1
4-1
4-1
4-1
4-2
4-3
4-3
4-3
4-3
4-5
4-5
APPENDIXES
A Character Data Input, Output, and
Central Memory Representation A-l
B Diagnostics B-l
C Glossary C-l
D Sort/Merge Parameter Summary D-l
E Interactive Dialog E-l
F Sort/Merge 5, Sort/Merge 4 Comparison F-l
INDEX
60484800 D v i i
FIGURES
1-1 Batch Job Flow 1-3
1-2 Interactive Job Flow 1-4
2-1 Internal Representation of Character
and Noncharacter Data 2-2
3-1 FROM Parameter Format 3-2
3-2 TO Parameter Format 3-2
3-3 KEY Parameter Format 3-3
3-4 DIR Parameter Format 3-3
3-5 L Parameter Format 3-3
3-6 E Parameter Format 3-4
3-7 EL Parameter Format 3-4
3-8 DIALOG Parameter Format 3-4
3-9 ENR Parameter Format 3-4
3-10 OWNF Parameter Format 3-4
3-11 OWNFL Parameter Format 3-5
3-12 OWNMRL Parameter Format 3-5
3-13 OWNn Parameter Format 3-5
3-14 RETAIN Parameter Format 3-5
3-15 SEQx Parameter Formats 3-5
3-16 STATUS Parameter Format 3-7
3-17 SUM Parameter Format 3-8
3-18 SUM Parameter Example 3-9
3-19 VERIFY Parameter Format 3-9
3-20 FASTIO Parameter Format 3-9
3-21 FILE Control Statement Format 3-10
4-1 NOS Login Example 4-1
4-2 NOS/BE Login Example 4-2
4-3 Incorrect Response Example 4-3
4-4 Output File Disposition Example 4-4
4-5 Interactive Command Example 4-4.1
4-6 Interactive Parameter Specification
Example 4-5
5-1 SM5S0RT Format 5-1
5-2 SM5MERG Format 5-2
5-3 SM5FR0M Format 5-2
5-4 SM5T0 Format 5-2
5-5 SM5KEY Format 5-2
5-6 SM5E Format 5-3
5-7 SM5EL Format 5-3
5-8 SM5ENR Format 5-3
5-9 SM5FAST Format 5-4
5-10 SM5N0DA 5-4
5-11 SM50FL Format 5-4
5-12 SM50MRL Format 5-4
5-13 SM50WNn Format 5-4
5-14 SM5RETA Format 5-5
5-15 SM5SEQx Formats 5-5
5-16 SM5ST Format 5-5
5-17 SM5SUM Format 5-6
5-18 SM5SUM Procedure Call Example 5-7
5-19 SM5END Format
6-1 C0B0L5 Control Statement Example
7-1 Owncode Routine Call and Subroutine
Statement Formats
7-2 Owncode Routine Record Flow
8-1 File UNIVER Record Layout
8-2 File UNIVER
8-3 Job Structure for Sorting File UNIVER
on Last Name
8-4 File UNIVER Sorted on Last Name
8-5 I nterac t i v e D i a log E x ample
8-6 Job Structure for Control Statement
Sort on Multiple Keys
8-7 File UNIVER Sorted on Multiple Keys
8-8 Input Files for Control Statement Merge
8-9 Job Structure for Control Statement
Merge
8-10 Merged File NEWU
8-11 Creating a Directive File
8-12 Using a Directive File (NOS)
8-13 File NUMFIL
8-14 Output From Sort Using a Directive File
8-15 File GRADES Record Layout
8-16 File GRADES
8-17 Interactive Parameter Specification
for SUM Example
8-18 Output From SUM Example
8-19 Job Structure for Sort Called From a
FORTRAN Program
8-20 FORTRAN Program With Sort/Merge
Procedure Calls
8-21 Owncode Routine
8-22 Output From FORTRAN Program
TABLES
2-1 Data in Sort Key Fields
2-2 Predefined Collating Sequences
2-3 Numeric Data Formats
2-4 Sign Overpunch Representation
3-1 $CHAR(n) Character Numbers
3-2 SEQS Parameter Summary
3-3 Error Level Codes, STATUS Parameter
3-4 Parameter Positional Order
3-5 File Characteristics
5-1 Result Array Format
5-2 Error Level Specification
5-3 Error Level Codes, SM5ST Call
7-1 Owncode Routine Summary
5-7
6-1
7-1
7-3
8-1
8-1
8-2
8-2
8-2
8-3
8-3
8-3
8-4
8-4
8-5
8-5
8-6
8-b
8-6
8-6
8-7
8-7
8-8
8-8
8-9
8-y
2-2
2-3
2-4
2-5
3-b
3-7
3-8
3-10
3-11
5-1
5-3
5-b
7-2
/^vPfLrS
""^^IS
'*^%.
viii 60484800 D
Jp^V NOTATIONS
0^S
Unless otherwise specified, the conventions de
scribed in the following paragraphs are used
throughout this manual in parameter and procedure
call formats, examples, and diagnostic messages.
UPPERCASE Uppercase letters indicate words,
acronyms, or mnemonics required as
input by Sort/Merge or produced as
output by Sort/Merge. Parameter
keywords and interactive commands
are included in this category.
lowercase Lowercase letters indicate words
or symbols that you must supply.
... Ellipsis in a parameter or pro
cedure call format indicates that
omitted portions of the format can
be repeated.
[ 1
nm
Brackets indicate an optional por
tion of a parameter or procedure
call format.
Two periods in a parameter format
indicate a range of letters or
digits.
Delta indicates a space (blank).
Boxes indicate character positions
in storage.
Unless otherwise indicated, all numbers in text are
decimal values.
60484800 A ix
GENERAL DESCRIPTION
S o r t / M e r g e V e r s i o n 5 i s a s e t o f p o w e r f u l a n d
efficient routines that provides high-speed sorting
or merging of re c o rds wi t h a single c o ntrol s t ate
ment* This section introduces the features of
Sort/Merge and provides you with an overview of the
Sort/Merge relationship with system software.
FUNCTIONS AND FEATURES
The purpose of sorting is to arrange items in
order; the purpose of merging is to combine two or
more sets of preordered items. Using Sort/Merge,
records are rearranged in the order you specify, or
t w o o r m o r e s o r t e d l e s a r e c o m b i n e d i n t o o n e
file. Sort/Merge offers the following features:
A sort or merge specification with a single
control statement
An optional directive file for sort or merge
specification
The capability of sorting or merging records
from as many as 100 files with one call to
Sort /Merge
Character and noncharacter sort key types
Five predefined collating sequences
User-defined collating sequences
Summing of numeric fields
Sorting of any CYBER Record Manager (CRM)
sequential file and any record type (except U)
A tutorial dialog for interactive sort or merge
specification
A set of procedures for sort or merge proc
essing from within a program written in FORTRAN
or some other language
Interface with COBOL programs through a C0B0L5
control statement option or direct calls
Owncode routines to insert, substitute, modify,
or delete records during Sort/Merge processing
These features are described briefly in the fol
lowing paragraphs.
Sorts are initiated with the S0RT5 control state
ment; merges are initiated with the MERGE control
statement. You specify processing requirements for
the sort or merge with parameters in the respective
control statement. Merge processing requires files
that have already been sorted. Sort/Merge gener
ates code based on the parameters and parameter
values that you include in the S0RT5 or MERGE
control statement.
The S0RT5 or the MERGE control statement can be up
to 240 characters in length. You can specify more
complex sorts or merges by using a directive file
for additional parameters. Sort/Merge reads the
parameters in a directive file after all of the
parameters in the control statement have been
read. Using a single control statement to specify
your sort or merge provides simplicity and elimi
nates the necessity of creating, saving, and
subsequently retrieving directive files. Directive
files, on the other hand, provide standardization
of installation parameters and collating sequences.
Records are sorted or merged on fields of data
within each input record; the fields are called
sort keys. Sort keys can be 6-bit character data,
signed or unsigned binary integers, or floating
point numbers. Data can be sorted or merged
according to a predefined or user-defined collating
sequence for character data, or according to
numeric value for numeric data. Numeric data can
be signed or unsigned.
Records with equal sort key fields can be combined
into one new record. You can specify that numeric
fields be added to the corresponding fields in the
other records with equal keys. The one resultant
r e c o r d c o n t a i n s t h e k e y e l d s a n d t h e n u m e r i c
fields that are the sums of the specified numeric
fields in all the records with equal keys; data
e l d s t h a t a r e n o t k e y o r s u m e l d s a r e s e t t o
the corresponding fields in one of the old records.
Sort/Merge uses CRM file processing and input/
output capabilities. Any of the CRM sequential
files or record types (except U) can be sorted or
m e r g e d ; t h i s i n c l u d e s b o t h x e d a n d v a r i a b l e
length records. Because Sort/Merge uses CRM, the
characteristics of files input to Sort/Merge and
files output from Sort/Merge must be described to
CRM with FILE control statements unless default
characteristics apply.
You can specify any sort or merge from your termi
nal by entering the S0RT5 or MERGE control state
ment and processing parameters. An interactive
d i a l o g i s a l s o a v a i l a b l e t o g u i d e y o u , s t e p b y
step, through your sort or merge specification.
The processing options are presented, and you
choose the option you want as well as identify your
files and sort key fields to Sort/Merge. Several
interactive commands are available to control the
use of the interactive dialog. During the dialog,
you can obtain an explanation of Sort /Merge usage
by entering HELP at your terminal.
A set of procedures exists that allows you to
initiate a sort or merge from within your program
writte n in F O RTR A N or some o t her l a n quage. T h e
same processing options are available using calls
to the procedures as are available using the S0RT5
or the MERGE control statement; the procedure calls
closely correspond to the Sort/Merge parameters.
60484800 B 1-1
A COBOL5 control statement option exists that
a l l o w s y o u t o u s e S o r t / M e r g e 5 . I f y o u s p e c i f y
S0RT5 in your C0B0L5 control statement, Sort/
Merge 5 is used when the COBOL SORT or MERGE state
ment in your program executes.
You can write routines, called owncode routines, to
insert, substitute, modify, or delete records
during Sort/Merge processing. Owncode routines are
s u b r o u t i n e s w r i t t e n i n F O R T R A N o r s o m e o t h e r
language. The routines must be compiled; the file
containing the compiled routines is loaded during
your sort or merge. Depending on the exit number
you specify, owncode routines are executed to
process input records, output records, or records
with equal keys. You can use owncode routines with
contro l statement sorts o r merges, or w i t h proce
dure calls to Sort/Merge.
CONFIGURATION AND SOFTWARE
RELATIONSHIPS
The hardware conguration needed to support Sort/
Merge Version 5 is the same as the minimum config
uration required for the NOS or NOS/BE operating
| s y s tem. O ne C D C CYB E R 170 or 1 80 s e r ies h o st
computer, together with peripheral processing units
and disk subsystem is necessary. For installation,
one tape unit is needed. Additionally, the inter
active feature of Sort/Merge requires one 255x
series communication subsystem.
Sort/Merge Version 5 resides in a library named
SRT5LIB on the NOS or NOS/BE operating system.
Sort/Merge requires only the basic NOS or NOS/BE
software. Sort/Merge interfaces with CYBER Record
Manager, which is one of the standard products
released as part of both operating systems.
Interactive use of Sort/Merge requires the Inter
a c t i v e F a c i l i t y ( I A F ) V e r s i o n 1 u n d e r N O S o r
INTERCOM Version 5 under NOS/BE. IAF in turn
interfaces with the network software Network Access
Method (NAM). The NOS Version 2 Reference Set,
Volume 1 (for NOS users) or the INTERCOM reference
manual (for NOS/BE users) contains information
concerning terminal requirements.
JOB FLOW
You can use Sort/Merge for batch processing or
i n t e r a c t i v e l y. F o r b a t c h s o r t j o b s , r e c o r d s t o b e
sorted can be in permanent files, input in the same
job with your SORT5 control statement and param
eters, or supplied by an owncode routine* For
m e r g e p r o c e s s i n g , r e c o r d s m u s t b e i n p r e s o r t e d
files assigned to the job and named in the MERGE
control statement. Sort/Merge uses CYBER Record
Manager for input and output. Sorted or merged
records can be written to a file and saved, listed
by a printer, or processed by an owncode routine.
Figure 1-1 illustrates batch job flow.
Interactively, records to be sorted or merged can
be in local files or in permanent files you assign
to your job; records to be sorted can also be
supplied by an owncode routine. You can enter the
SORT 5 or MERGE control statement and processing
parameters from your terminal, or you can use the
i n t e r a c t i v e d i a l o g t o sp e c i f y y o u r so r t o r m e r g e .
At the end of the sort or merge, records are in a
local file that can be displayed at your terminal,
saved as a permanent file, or listed by a printer;
output records can also be processed by an owncode
routine. Figure 1-2 illustrates interactive
j o b o w.
1-2 60484800 D
jSfiSfF^^S,
0ms.
A. Sort
Records supplied
by an owncode
routine
Permanent
file to be
sorted
Sort
Parameters
CYBER
I R e c o r d |
Manager .
Sort/Merge
INPUT
file to be
sorted
Sorted file
saved as a
permanent file
Sorted file
printed out
Sorted records
processed by an
owncode routine
B. Merge
Sorted files
to be
merged
1 CYBER
| R e c o r d |
Manager .
Sort/Merge
Merge
Parameters
Merged file
saved as a
permanent file
Merged file
printed out
Merged records
processed by an
owncode routine
Figure 1-1. Batch Job Flow
^ m s
60484800 A 1-3
A. Sort
Permanent
file to be
sorted
Records supplied
by an owncode
routine
Interactive
sort specification
1 C Y B E R '
| R e c o r d |
. Manager
.s: INTER-
I C O M I
I I
Sort/Merge
Sorted file
saved as a
permanent file
Sorted file
printed out
Sorted records
processed by an
owncode routine
B. Merge
Interactive
I merge specication
I C Y B E R I
| R e c o r d |
Manager .
I I
Sort/Merge
Merged file
saved as a
permanent file
Merged file
printed out
Merged records
processed by an
owncode routine
^S^v
Figure 1-2. Interactive Job Flow
1-4 60484800 B
SORT KEYS
r
j^ss-
0m*s
ym^s
All sort or merge operations are based on the
ordering of values assigned to the data to be
sorted or merged, which are called sort keys. This
section includes an explanation of sort keys and a
discussion of the information you must supply to
describe sort keys to Sort/Merge.
DEFINITION
A sort key is a field of data within each record in
an input file to be sorted or in a presorted file
t o b e m e r g e d w i t h o n e o r m o r e o t h e r l e s . T h e
field is used by Sort/Merge to determine the order
in which records are output. A file can be sorted
or merged on more than one field of data; key
fields must occur in the same position and be the
same length in each record, and the total number of
key characters must be less than 256 (if you also
specify sum fields, the total number of characters
in the key and sum fields together must be less
than 256). Sort keys in files with variable length
r e c o r d s c a n n o t e x t e n d b e y o n d t h e l e n g t h o f t h e
shortest record in the file; the sort key field
mu s t be pr e se nt in ev er y r e co rd . F o r ex a mp le , i f
the records range from a minimum of 25 characters
to a maximum of 80 characters, all sort keys must
be in the first 25 characters.
The first key you specify is the most important key
and is called a major sort key. The keys you
specify after the first key are of lesser
importance and are called minor sort keys. Each
sort key describes the length of the field, the
po s it i on of the e ld w it h in ea c h r ec o rd , t h e t ype
o f d a t a e x p e c t e d i n t h a t e l d , a n d t h e e f f e c t o f
that data on the sort order. When you specify
multiple sort keys, the keys can differ as to type
of data, collating sequence, and sort order. The
alignment of data in sort keys is important.
Character data must be left-justified in the field;
numbers must be right-justified in the field.
An example of a file with multiple sort keys is a
university student file with a record for each
student. Each record includes the last name and
first and middle initials, the student number, the
date of birth, the field of study, the grade point
average, and a code representing class (freshman,
sophomore, junior, senior); all the fields are
written with character data. The file could be
maintained with the student number as the major
key - records are normally retrieved by specifying
the student number. The file can be sorted by the
name in standard alphabetic order when a list of
student names is needed*
When a university department needs to know which
students are majoring in fields within the
depart m e n t, t h e le can b e sort e d on the e l d of
st u dy. T he s am e s o rt can sp e ci f y t he n am e a s a
minor key so that records with the same field of
study are also sorted in alphabetic order by the
name. The le can be sorted by the class code as
the major key, a n d by the g r ade poi n t averag e in
descending numeric order as a minor key to give a
lis t by clas s wi t h t h e st u dent s ha v ing the h igh e st
grade point average at the beginning of the list.
DESCRIBING SORT KEYS
You must describe to Sort/Merge every field of data
that you want used as a sort key. Sort key
descriptions include the following information:
Starting location of the key within the record
K e y l e n g t h
Ty p e o f da t a i n th e k e y f i e l d
Sort order
You describe sort keys with either the KEY
parameter in a control statement or directive file,
or with the SM5KEY procedure call. The options and
defaults for describing sort keys are discussed in
the following paragraphs.
KEY LENGTH AND POSITION
Y o u d e n e k e y fi e l d l e n g t h a n d p o s i t i o n b y
specifying the first byte or bit of the field and
either the number of bytes or bits in the field
( l e n g t h o f t h e e l d ) , o r t h e l a s t b y t e o r b i t o f
the field. The leftmost byte and the leftmost bit
in a record are counted as number 1. For character
data, each character is six bits and occupies one
byte. For example, if you want to specify the name
of the university student file as a sort key, and
the name field is the leftmost field in the record,
you specify the first byte as 1. If the name field
is 20 characters long, you specify length as 20.
Sort/Merge interprets the integers you specify for
key length and position as bit numbers when the key
type (discussed later in this section) specifies
bits; otherwise, byte numbers are assumed. Unless
the SEOA parameter or SM5SEQA procedure is used,
k e y e l d s c a n o v e r l a p o n e a n o t h e r . N o d e f a u l t
e x i s t s f o r t h e s t a r t i n g l o c a t i o n o f a k e y w i t h i n a
record; you must specify the starting location. If
you do not specify the length of a key, length
defaults to 1.
KEY TYPE
Yo u s p e c i f y t h e t y p e o f d a t a i n a k e y e l d w i t h
the name of a collating sequence or with the name
of a nu m e ric da t a forma t . T he data in a key eld
ca n b e ch ar ac te r o r no nc ha ra ct er. C h a r a c t e r da ta
is represented in the computer as display code
values. To indicate the key type for character
data, you specify the name of a collating sequence
or, for numeric character data, the name of a
numeric data format. Noncharacter data is
represented in the computer as binary values. To
indicate the key type for noncharacter data, you
specify the name of a numeric data format.
60484800 D 2-1
Figure 2-1 illustrates the difference between the
internal representation of character and nonchar
acter data. Table 2-1 summarizes character and
noncharacter data types and the associated sort
key type.
A. Character data
1
Octal equivalent of display code character
2 9 2 4 1 8 1 2 6 0
t46 34 35 36 37
B. N oncharacter data
-1234
Octal equivalent of binary value
5 9 0
77...775455
Figure 2-1. Internal Representation of Character
and Noncharacter Data
If a sort key field contains any characters that
are not meaningful for the key type you specify (an
alphabetic character in a field defined as a
numeric key for example), the sort order for that
k e y fi e l d i n t h a t r e c o r d i s u n d e n e d . I n t h e
o u t p u t l e , t h e d a t a f o r t h a t k e y e l d i n t h a t
record is also undefined. The record is still
sorted according to any other sort keys you have
specified.
The collating sequences and numeric data formats
you can specify are discussed in the following
paragraphs.
Collating Sequences
A collating sequence determines the precedence
given to each character in relation to the other
characters. You specify a collating sequence for
c h a r a c t e r d a t a t o d e t e r m i n e t h e s o r t o r d e r. T h e
data must be display code characters.
Five predefined collating sequences are available
to you as a Sort/Merge user: ASCII6, C0B0L6,
DISP L AY, EBCDIC6, and INTBCD. The default col
lating sequence is ASCII6. Table 2-2 shows the
predefined collating sequences.
If none of the predefined collating sequences
orders data as you would like, you can define a
nonstandard collating sequence. If you are using
c o n t r o l s t a t e m e n t c al l s t o S o r t / M e r g e , y o u d e n e
your own collating sequence with SEQx parameters in
the S0RT5 or MERGE control statement. If you are
using the procedure calls, you define your own
collating sequence with SM5SEQx procedure calls.
Numeric Data Formats
Numeric data can appear in a key field in one of
the formats listed in table 2-3. Numeric data can
be signed or unsigned. For character numeric data
that is signed, the sign can be a oating sign, an
overpunch representation over the leading (left
most) digit, a leading separate character, an over-
punch representation over the trailing (rightmost)
di g it , o r a t r ai l in g s ep a ra te ch a ra c te r.
A floating sign is a negative sign embedded between
leading blanks and the numeric characters; leading
zeros must be converted to blanks. Positive values
in this format are not signed. The following
examples are valid oating sign formats:
AA - 1
A A A 1
A A A 0
12 3 4
0*™*W$$\
TABLE 2-1. DATA IN SORT KEY FIELDS
Type Internal
Representation
Data
in Field Type
Specied b y
Data Ordered
According to
Alphabetic Name of a collating
sequence
Specified
collating
sequence
Character Display code
Numeric
Name of a collating
sequence
Name of a numeric
data format
S p e c i fi e d
collating
sequence
Numeric
value
Noncharacter Binary value Numeric Name of a numeric
data format
Numeric
value
'"^y
2-2 60484800 A
TABLE 2-2. PREDEFINED COLLATING SEQUENCES
ym^s
Collating
Sequence ASCI16 C0B0L6 DISPLAY EBCDIC6 INTBCD
Decimal Octal Graphics Display
Code Graphics Display
Code Graphics Display
Code Graphics Display
Code Graphics
CDC
INTBCO
Code
00 00 blank 55 blank 55 :t 00 blank 55 00
01 01 66 no. 01 57 01
02 02 ii 64 xt 63t 02 72 02
03 03 60 61 03 51 03
04 04 It 53. -* 65 04 45 04
05 05 63? 60 05 66 05
06 06 67 A\ 67 06 67 06
07 07 70 70 07 53 07
08 10 51 71 10 47 10
09 11 52 73 11 52 11
10 12 47 75 12 11 12
11 13 45 —1 76 13 -i 76 13
12 14 56 57 14 46 14
13 15 46 52 15 50 15
14 16 57 77 16 56. 16
15 17 50 45 17 xt 63t 17
16 20 33 53 20 65 20
17 21 34 47 21 73 21
18 22 35 46 22 71 22
19 23 36 50 23 00 23
20 24 37 56 24 60 24
21 25 40 51 25 <a 74 25
22 26 41 54 26 70 26
23 27 42 64 27 54 27
24 30 43 72 30 it 64 30
25 31 44 01 31 61 31
26 32 :t 00 02 32 01 32
27 33 11 03 33 02 33
28 34 11 04 34 03 34
29 35 54 05 35 04 35
30 36 73 06 36 05 -i 36
31 37 71 07 37 06 37
32 40 74 10 40 07 40
33 41 01 11 41 10 41
34 42 02 66 42 11 42
35 43 03 12 43 62 43
36 44 04 13 44 12 44
37 45 05 14 45 13 45
38 46 06 15 46 14 46
39 47 07 16 47 15 47
40 50 10 17 50 16 50
41 51 11 20 51 17 51
42 52 12 21 52 20 52
43 53 13 22 53 21 53
44 54 14 62 54 22 54
45 55 15 23 blank 55 none 75 55
46 56 16 24 56 23 56
47 57 17 25 57 24 57
48 60 20 26 60 25 blank 60
49 61 21 27 61 26 61
50 62 22 30 ] + 62* 27 62
51 63 23 31 xt 63t 30 63
52 64 24 32 64 31 64
53 65 25 00 65 32 65
54 66 26 33 66 33 66
55 67 27 34 A\ 67 34 67
56 70 30 35 70 35 70
57 71 31 36 71 36 71
58 72 32 37 72 37 72
59 73 61 40 73 40 73
60 74 75 41 74 41 74
61 75 62 42 75 42 75
62 76 SS 76 43 —1 76 43 76
63 11 65 44 11 44 A\ 11
+
'I n in st a l l a t ions using a 63-gra phic set, the X grap hie does not exist. The : graphic is display code 63.
60484800 A 2-3
TABLE 2-3. NUMERIC DATA FORMATS
Name Data Type Sign Comments
NUMERIC_LO Numeric characters Leading overpunch All characters are decimal digits except the
leading character, which indicates a sign by
an overpunch. Data is ordered according to
numeric value with negative zero ordered
before positive zero.
NUMERIC_LS Numeric characters Leading separate All characters are decimal digits except the
leading character, which is a negative or
p o s i t i v e s i g n . S p e c i f y i n g a e l d t h a t i s
not at least two characters in length causes
a fatal error. Data is ordered according to
numeric value with negative zero ordered
before positive zero.
NUMERIC_TO Numeric characters Trailing overpunch All characters are decimal digits except the
trailing character, which indicates a sign by
an overpunch. Data is ordered according to
numeric value with negative zero ordered
before positive zero.
NUMERICJTS Numeric characters Trailing separate All characters are decimal digits except the
trailing character, which is a negative or
p o s i t i v e s i g n . S p e c i f y i n g a e l d t h a t i s
not at least two characters in length causes
a fatal error. Data is ordered according to
numeric value with negative zero ordered
before positive zero.
NUMERIC_NS Numeric characters None All characters are decimal digits. Data is
ordered according to numeric value.
NUMERICJFS Leading blanks,
numeric characters
- sign for negative
values; a + character
is not allowed
The field contains leading blanks (leading
zeros must be converted to blanks); if the
value is negative, the right-most leading
blank must be converted to a minus sign. If
the field contains no leading blanks, the
value must be positive. This format is
equivalent to the FORTRAN I format. Data is
ordered according to numeric value with
negative zero ordered before positive zero.
BINARY Binary integer None The field starts and ends on character bound
aries. Data is ordered according to numeric
value.
BINARYJBITS Binary integer None The eld does not start or end on character
boundaries. Data is ordered according to
numeric value.
INTEGER One's complement
binary integer
Positive if leftmost
bit is 0; negative if
leftmost bit is 1
The field starts and ends on character bound
aries. Data is ordered according to numeric
value with negative zero ordered before posi
tive zero.
INTEGERJBITS One's complement
binary integer
Positive if leftmost
bit is 0; negative if
leftmost bit is 1
The eld does not start or end on character
boundaries. Data is ordered according to
numeric value with negative zero ordered
before positive zero.
REAL Normalized binary
real or floating
point number
Signed The field occupies a full computer word and
is aligned on word boundaries. Data is
ordered according to numeric value with all
forms of zero ordered equally. The order of
indefinite values is undefined.
2-4 60484800 C
^^*^-
The following examples are not valid floating sign
formats:
A A 0 1 Leading zero not allowed
A - 0 1 Leading zero not allowed
+12 3 Positive sign not allowed
AAAA All blank field not allowed
the collating sequence you specify. For numeric
keys sorted in descending order, the record having
the key with the lowest value is written last on
the output file. Descending character keys are
sorted in reverse order of the collating sequence
you specify. The default sort order is ascending.
TABLE 2-4. SIGN OVERPUNCH REPRESENTATION
A negative sign overpunch is equivalent to
overstriking a digit with a - , which is a punch in
ro w 11. A positive si gn overpunch is equivalent to
overstriking a digit with a + , which is a punch in
row 12. When a signed overpunch digit is received
as input, the digit is punched as indicated in the
second column of table 2-4. When a signed
overpunch digit is displayed as output, the digit
appears as indicated in the third column of
table 2-4. Noncharacter numeric data can be signed
or unsigned binary integers or normalized floating
point numbers.
You define numeric key fields by specifying the
first byte of the field and either the length of
the field or the last byte of the field. For types
BINARYJBITS and INTEGER_BITS, you specify the rst
bit position of the field and either the length of
the field in bits or the last bit of the field.
SORT ORDER
The order for sorting keys is ascending or
descending. For numeric keys sorted in ascending
order, the record having the key with the highest
value is written last on the output file.
Ascending character keys are sorted according to
Sign and Input Output
Digit Punch Representation
+9 12-9
+8 12-8
+7 12-7
+6 12-6
+5 12-5
+4 12-4
+3 12-3
+2 12-2
+1 12-1 A.
+0 12-0 [t
-0 11-0 ]t
-1 11-1
-2 11-2
-3 11-3
-4 11-4
-5 11-5
-6 11-6
-7 11-7
-8 11-8
-9 11-9
tvalid on NOS with 029 keypunches. See
appendix A, table A-2, for NOS/BE repre
sentations of +0 and -0.
60484800 B 2-5
CONTROL STATEMENT SORTS OR MERGES
r
y^$S
0^s
This section
through control
that can appear
statement are
d i r e c t i v e l e s ,
requirements for
are explained.
describes Sort/Merge processing
statement calls. The parameters
in a S0RT5 or in a MERGE control
discussed, along with optional
The CYBER Record Manager (CRM)
co ntrol sta temen t so rts or merges
SORT5 CONTROL STATEMENT
Sort/Merge sort capabilities are available through
the S0RT5 control statement. Sort/Merge generates
code based on the parameters you specify in the
S0RT5 control statement (and directive files, if
used) or on default values. Sort/Merge generates
the code to make efficient use of memory, mass
storage, and the central processor.
The control statement begins with the word S0RT5,
which must be followed by a period. The control
statement can appear in one of the following forms:
S0 RT5 .p l , p 2 , . .. ,p n
S0RT5.plAp2A ...Apn
In the preceding control statement examples, p
represents a processing parameter. Parameters must
be separated by commas or spaces; commas and spaces
can be used interchangeably.
The S0RT5 control statement can be processed in a
batch job or entered interactively from a ter
minal. The control statement must be CRM block
type C (BT=C) and record type Z (RT=Z) format (see
the CRM Basic Access Methods reference manual for
information on block types and record types). Each
l i n e o f t h e c o n t r o l s t a t e m e n t c a n b e u p t o 1 0 0
characters in length; however, characters in excess
of 80 are ignored.
In interactive mode, control statements cannot be
continued on more than one line. Instead, you can
either create a directive file or use a procedure
file so you can use a text editor to verify or
change complex sort specifications.
In batch mode, you can continue a control statement
on more than one line by terminating the line with
two or more periods and beginning the new line with
one period.
NOTE
Continuation is not allowed for ranges
(indicated by two periods); ranges must be
started and completed on the same line.
You can continue a control statement on any number
of lines up to a maximum of 240 characters; periods
used as continuation symbols are not included in
the character count.
MERGE CONTROL STATEMENT
Sort/Merge merge capabilities are available through
the MERGE control statement. The input files for a
merge must be presorted. Input files for a merge
with summing must be presorted and presummed. When
called with the MERGE control statement, Sort/Merge
generates code based on the parameters you specify
i n t h e c o n t r o l s t a t e m e n t ( a n d d i r e c t i v e l e s , i f
used) or on default values. Sort/Merge generates
code to make efficient use of memory, mass storage,
and the central processor.
The control statement begins with the word MERGE,
which must be followed by a period. The control
statement can appear in one of the following forms:
MERGE.pl,p2,...,pn
MERGE.pl A p2 A ...Apn
In the preceding control statement examples, p
represents a processing parameter. Parameters must
be separated by commas or spaces; commas and spaces
can be used interchangeably.
The MERGE control statement can be processed in a
batch job or entered interactively from a ter
minal. The control statement must be CRM BT-C and
RT=Z format. Each line of the control statement
can be up to 100 characters in length; however,
characters in excess of 80 are ignored.
In interactive mode, control statements cannot be
continued on more than one line. Instead, you can
either create a directive file or use a procedure
file so you can use a text editor to verify or
change complex sort specications.
In batch mode, you can continue a control statement
on more than one line by terminating the line with
two or more periods and beginning the new line with
one period. You can continue a control statement
on any number of lines up to a maximum of 240 char
acters; periods used as continuation symbols are
not included in the character count.
DIRECTIVE FILES
A control statement sort or merge can use optional
directive files that contain processing parameters
in addition to the parameters in the S0RT5 or the
M E R G E c o n t r o l s t a t e m e n t . U s e o f d i r e c t i v e l e s
allows specification of more complex sorts or
merges (specifications that could be longer than
allowed in a control statement) and permits stan
dardization of installation parameters and collat
ing sequences.
You can specify multiple directive files for a
single control statement sort or merge. All
directive files must be CRM sequential files of
block type C (BT=C) and record type Z (RT=Z) with
record length (FL) of 100 characters or less;
however, characters in excess of 80 are ignored.
60484800 C 3-1
In a directive file, each statement can be up to
240 characters in length. Each statement must
begin with the word SORT or with the word MERGE
followed immediately by a comma or a space, and
then followed by processing parameters, which are
separated by commas or spaces. The following
ex a m p le s i ll u st ra t e d i r ec t iv e le fo rm a ts :
S0RT,pl,p2,...,pn
MERGE plAp2A...Apn
You can continue a directive le statement on more
than one line by terminating the line with two or
more periods. The new line must not begin with a
period but can begin with one or more spaces. You
specify directive files in the S0RT5 or MERGE
control statement with the DIR parameter, discussed
in the Sort/Merge Parameters subsection.
SORT/MERGE PARAMETERS
You specify various parameters in the S0RT5 or the
MERGE control statement, or in a directive file, to
direct Sort/Merge processing. Most parameters can
appear either in a control statement or in a direc
tive file. The DIALOG parameter cannot appear in a
directive file. Unless stated otherwise, a param
eter can appe a r o n l y o n ce i n yo u r s o r t o r me r g e
specification; a fatal error results if you specify
duplicate parameters. You can specify parameters
with keywords or by position in the control state
m e n t o r d i r e c t i v e fi l e . W h e n s p e c i fi e d w i t h
keywords, parameters take one of the following
forms, depending on the parameter:
keyword=((value-set)[,(value-set)]...)
keyword=value
Spaces can appear anywhere in a parameter except
within a name, a number, or a range indicator. The
order for specifying parameters by position follows
t h e d e s c r i p t i o n s o f t h e i n d i v i d u a l p a r a m e t e r s .
Refer to section 7 for information on owncode
routines, which are mentioned in the descriptions
of several of the parameters.
FROM
The FROM parameter (figure 3-1) specifies the input
les from which the records to be sorted or merged
are read* As many as 100 files can be sorted or
merged in one job step. The files are read in the
order that, you specify them; a file cannot be
specified more than once for a merge. The files
are read past end-of-record marks; reading termi
nates when end-of-file or end-of-information is
encountered (see the CRM Basic Access Methods
reference manual). The files are rewound before
and after use unless the name of the le is INPUT
or a FILE control statement parameter specifies
otherwise. If a file is open when Sort/Merge is
called, it is not rewound after use because the CF
value in the FIT is undetermined.
If you specify the le $NULL with the FROM param
eter, records to be sorted are not read from a file;
records must be supplied by an owncode routine.
You can specify the FROM parameter more than once
in a directive file. If you omit the FROM param
et er, re co r ds t o b e s or t ed a r e r e a d f r o m t he l e
OLD (unless an owncode routine supplies records).
An empty FROM file results in a null sort. The i
FROM file cannot be the same as the TO file.
FROM=lfn
FROM=(lfn1,lfn2,...)
FROM=$NULL
lfn Logical file name
beginning with a
; 1 to
letter.
letters or digits.
Figure 3-1. FROM Parameter Format
TO
The TO parameter (figure 3-2) specifies the file to
which sorted or merged records are written (unless
an owncode routine processes all records). The file
is not rewound before or after use unless a FILE
control statement parameter specifies otherwise.
TO=lfn
TO=$NULL
lfn Logical file name; 1 to 7 letters or digits,
beginning with a letter.
Figure 3-2. TO Parameter Format
If you specify the file $NULL with the TO param
eter, sorted or merged records are not written to a
file; you must supply an owncode routine to process
all records. If you omit the TO parameter, records
are written to the le NEW (unless an owncode
routine processes all records). The TO file cannot
be the same as the FROM file.
KEY
The KEY parameter (figure 3-3) specifies the key
fields that determine the sorted or merged order of
output records. You can specify the KEY parameter
more than once in a directive file on separate com
mand lines. A maximum of 100 key fields can be
specified.
Each key_def defines a separate key. They are
defined in the order of precedence, from major key
to minor key, read left to right. A key_def may
consist of a range. A range consists of the first
and last byte of the key, separated by two periods.
A s in gl e i n t eg er m a y be co ns id er ed a s a sp ec ia l
case of a range in which the first and last byte
a r e t h e s a m e . I f a k e y _ d e f c o n s i s t s o f a n y t h i n g
more than a range, it must be enclosed within
p a r e n t h e s e s , o r e l s e i t w i l l b e p r o c e s s e d a s a
multiple key sort.
The key position and length are the first byte of
the field and either the number of bytes or bits in
the field (length of the field) or the last byte or
bit of the field. You specify first and length (or
last) as integers; the leftmost byte and the
leftmost bit in a record are counted as number 1.
For character data, each character is six bits and
o c c u p i e s o n e b y t e . F o r a l l t y p e s o f d a t a , r s t
3-2 60484800 D
KEY = "(key_def [,key_def] ...)1
range J
key_def [range "1
(range [.type [,ad] ])
L{first,length[,type[,ad] ]) J
range [first ]
[first.. last J
first First byte or bit of the key field.
last Last byte or bit of the key field.
length Number of bytes or bits in the key field;
default is 1.
type Name of a numeric data format or
collating sequence; default is ASCI 16.
ad Order: A for ascending, D for descend
ing; default is ascending.
Figure 3-3. KEY Parameter Format
and length (or last) refer to bytes except for the
formats BINARYJBITS and INTEGER_BITS. You must
specify the first byte or bit of a key field. If
you do not specify otherwise in the KEY parameter,
the key length is assumed to be 1.
The key type is the name of a predefined or
user-defined collating sequence or the name of a
numeric data format. If you do not specify a key
type, the type is assumed to be the ASCII6
collating sequence. See section 2 for a list of
predefined collating sequences and numeric data
formats.
Sort order is either ascending or descending, and
you specify A or D, respectively. If you specify
neither, the sort order is assumed to be
ascending. For numeric keys sorted in ascending
order, t h e rec o r d hav i n g the key w i th th e high e s t
value is written last on the output file.
Ascending character keys are sorted according to
the collating sequence you specify. For numeric
keys sorted in descending order, the record having
the key with the lowest value is written last on
the output file. Descending character keys are
sorted in reverse order of the collating sequence
you specify.
Records are first sorted according to the key field
described by the leftmost key_def. Records with
equal values for the major key field are sorted
according to the field described by the next
key_def, and so on. A fatal error occurs if key
fields overlap one another and the SEQA parameter
is specified. A fatal error also occurs if the
total number of key characters is more than 255.
(I f y o u a ls o s p e c i f y s um e l d s , t h e to ta l n u m b e r
of characters in the key and sum fields together
must be less than 256.)
You must be careful when defining a sort with a
single key. The following command defines a single
key that is 20 bytes long, starting in byte 6:
S0RT5. KEY=6..25
The following command denes the same sort key:
S0RT5. KEY=((6,20))
The following command defines a sort on two single
byte keys where byte 6 is the major key and byte 20
is the minor key:
S0RT5. KEY=(6,20)
If you omit the KEY parameter, the following
assumptions are made: KEY=1.. (minimum record
length), the record length is the smallest MNR in
the F I L E con t r o l state m e n ts for input les ( o r the
smallest FL for F and Z records), the key type is
the ASCII6 collating sequence, and the sort order
is ascending.
DIR
The DIR parameter (figure 3-4) specifies a direc
tive file or files from which sort or merge param
eters are read. Parameters in a directive file are
read only after all of the control statement param
eters have been read. The files are read in the
order that you specify them. The files are rewound
before and after use unless the name of the file is
INPUT or a FILE control statement parameter speci
fies otherwise.
DIR=lfn
DIR=(lfn1,lfn2 )
lfn Logical le name; 1 to 7 letters or digits,
beginning with a letter.
Figure 3-4. DIR Parameter Format
You can specify the DIR parameter more than once in
a directive file. If you omit the DIR parameter,
no parameters are read from a directive file; the
sort or merge is completely specied in the SORTS
or the MERGE control statement.
The L parameter (figure 3-5) specifies the file to
w h i c h l i s t i n g i n f o r m a t i o n i s w r i t t e n . T h e l i s t i n g
l e i s wr it te n i n C R M B T= C, RT = Z f o r m a t wi th a
default full length of 132. Listing information
in cl ud es t h e S o r t / M e rg e v e r s i o n n u m b e r, d ir ec ti v e
le stat e ment s , t h e ti m e a n d d a te, and d iag n osti c
messages, if any.
L=lfn
L=$NULL
lfn Logical file name; 1 to 7 letters or digits,
beginning with a letter.
Figure 3-5. L Parameter Format
0ms
60484800 D 3-3
The listing le is not rewound before or after use
unless a FILE control statement parameter specifies
rewind. If you specify the file $NULL with the L
parameter, listing information is not written. If
you omit the L parameter, listing information is
written to the file OUTPUT.
o t h e r pa r a m e t er s ( e x c ep t t h e S TAT U S p a r a m et er )
specified in a control statement along with the
DIALOG parameter do not affect sort or merge proc
essing; the sort or merge is performed solely on
the basis of your dialog responses. Interactive
u s e o f t h e d i a l o g i s d e s c r i b e d i n s e c t i o n 4 , a n d
the text of the dialog is included in appendix E.
/^"^ fek
The E parameter (figure 3-6) specifies the file to
which diagnostic messages are written. The error
file is written in CRM BT=C, RT=Z, and FL=72
format* The file is not rewound before or after
u s e u n l e s s a F I L E c o n t r o l s t a t e m e n t p a r a m e t e r
species to rewind.
E=lfn
E=$NULL
lfn Logical file name; 1 to 7 letters or digits,
beginning with a letter.
Figure 3-6. E Parameter Format
If you specify a listing file with a file name
different from the error file name, diagnostic
messages are written to the listing file and to the
error file. If you specify the file $NULL with the
E parameter, diagnostic messages are not written.
If you omit the E parameter, diagnostic messages
are written to the listing file.
EL
The EL parameter (figure 3-7) specifies the error
level to be reported. .If EL=T, all trivial errors,
plus all errors of levels W, F, and C, are reported.
If EL=W, all warning errors, plus all errors of
levels F and C, are reported. If EL=F, all fatal
errors, plus all errors of level C, are reported.
If EL^C, all catastrophic errors are reported.
Omitting the EL parameter is equivalent to EL=W.
EL=T
EL=W
EL=F
EL=C
Figure 3-7. EL Parameter Format
Errors are written to the error file or, if no
e r r o r l e i s s p e c i e d , t o t h e l i s t i n g l e . S e e
appendix B for an explanation of the four levels of
errors.
DIALOG
The DIALOG parameter (figure 3-8) invokes an inter
active dialog between you and Sort/Merge. The
DIALOG parameter can appear only in a control
statement. If DIALOGUES, the dialog is invoked;
if DIALOG=NO, the dialog is not invoked. Omitting
the DIALOG parameter is equivalent to DIALOG=NO.
The DIALOG parameter can be abbreviated as DIA, and
Y or N can be specified instead of YES or NO. Any
3-4
DIALOG=YES (or DIA=Y)
DIALOG=NO (or DIA=N)
Figure 3-8. DIALOG Parameter Format
NOTE
Before entering a S0RT5 or MERGE command
w i t h t h e D I A L O G p a r a m e t e r, e n s u r e t h a t
your terminal is in normal mode by enter
ing the NORMAL terminal command. If your
terminal is in ASCII mode during the
interactive dialogue, Sort/Merge cannot
recognize your responses unless you enter
them using uppercase letters only.
If you are already in the dialog, and need
to change the terminal mode, enter a
control-T to return to the system.
ENR
The ENR parameter (figure 3-9) specifies the esti
mated number of records to be sorted or merged.
You specify either a single value or a range of
values, and decimal integers (from 0 through
1000000000) or the CYBER Control Language (CCL)
variables Rl, R2, R3, RIG, EF, or EFG. If ENR is
specified as less than 1500, Sort/Merge uses less
memory for the initial sort phase. This causes
noticeably less memory required for the entire sort
if the actual number of records is a low number.
ENR=expr
ENR=expr . . expr
expr Expression that is a decimal integer,
variable R1,R2,R3,R1G,EF, or EFG.
or CCL
Figure 3-9. ENR Parameter Format
OWNF
The OWNF parameter (figure 3-10) specifies the file
that is the source of owncode routines; the file,
which must contain relocatable object modules, is
loaded by Sort/Merge by means of the user call
loader. The load map from loading the routines is
written to file ZZZZZLM.
OWNF=lfn
lfn Logical file name; 1 to 7 letters or digits,
beginning with a letter.
Figure 3-10. OWNF Parameter Format
60484800 D
^^\
#^
0jm*s
J^S
OWNFL
The OWNFL parameter (figure 3-11) specifies the
exact number of characters in any record from an
owncode routine. The integer you specify can be
from 1 to 5000. The OWNFL parameter can be
a b b r e v i a t e d a s O F L . S e e t h e d i s c u s s i o n o f t h e
OWNMRL parameter for default values.
OWNFL=integer
OFL=integer
Figure 3-11. OWNFL Parameter Format
OWNMRL
The OWNMRL parameter (figure 3-12) specifies the
maximum length in characters of any record from an
owncode routine. The integer you specify can be
from 1 to 5000. The OWNMRL parameter can be
abbreviated as OMRL. You do not need to specify
the OWNMRL parameter if the sort or merge has an
input or output file with a maximum record length
at least as long as the longest record supplied by
an owncode routine.
OWNMRL=integer
OMRL=integer
Figure 3-12. OWNMRL Parameter Format
If you omit both the OWNMRL and the OWNFL param
eters, the record length specification of records
I from an owncode routine depends on the length
specifications of the input and output files. If
all input and output files have fixed length
records of the same length, this length is used as
a default OWNFL value; otherwise, the largest MRL
or FL from any input or output file is used as a
default OWNMRL value.
I f t h e s o r t h a s n o i n p u t o r o u t p u t l e s ( r e c o r d s
to be sorted are supplied by an owncode routine and
sorted records are processed by an owncode rou
tine), you must specify either OWNFL or OWNMRL;
otherwise, a fatal error results. You cannot
specify both the OWNFL and OWNMRL parameters for
the same sort. Use of OWNFL rather than OWNMRL can
increase performance.
OWNn
The OWNn parameter (figure 3-13) specifies the name
of an o w n code ro u t ine tha t is executed each t i m e
point n is reached during the sort or merge; n must
be 1, 2, 3, 4, or 5* Owncode routines named by the
OWNn parameter must be in the OWNF file. All
o w n c o d e r o u t i n e s a r e l o a d e d b e f o r e t h e s o r t o r
merge is started. If you omit the OWNn parameter,
no owncode routine is executed.
OWNn=proc
n 1 , 2 , 3 , 4 , o r 5
proc Procedure-name; 1 to 31 letters, digits or
the special characters ? # @ _. Only 7
characters are significant and the first must
be a letter.
Figure 3-13. OWNn Parameter Format
RETAIN
The RETAIN parameter (figure 3-14) directs Sort/
Merge to output records with equal sort keys in the
same order as the records are input (RETAIN=YES).
If RETAIN=N0, or if you omit the RETAIN parameter,
records with equal sort keys might not be output in
the same order as they are input. If RETAIN=YES
and you specify more than one sort or merge input
l e w i th the FR O M p ar a met e r, t he ord e r i n w hi c h
you specify the files is the order in which records
with equal keys are output. The RETAIN parameter
can be abbreviated as RET, and Y or N can be speci
fied instead of YES or NO.
RETAIN=YES {or RET=Y)
RETAIN=NO (or RET=N)
Figure 3-14. RETAIN Parameter Format
You cannot specify both the RETAIN and the SUM
parameters in the same sort or merge. If you do
specify both, a catastrophic error occurs.
SEQx
The SEQx parameters (figure 3-15) define your own
collating sequence. The SEQN parameter signals the
start of your collating sequence definition and
names the sequence; name is used as the key type in
the KEY parameter when records are sorted according
to your collating sequence. Specifying a name that
is the same as the name of one of the predefined
collating sequences results in a fatal error.
SEQN=name
SEQS=('char', , 'char')
[SEQR=YES or SEQR=Y]
[SEQA=YES or SEQA=Y]
char
Collating sequence name; 1 to 31 letters,
digits, or the special characters ? # @ _.
Only 10 characters are significant and the
first must be a letter.
Character in the collating sequence.
Figure 3-15. SEQx Parameter Formats
60484800 D 3-5
Collating positions are assigned to the characters
in your collating sequence by SEQS parameters; each
SEQS parameter specifies either a single value step
or a range of value steps in the sequence. A value
s t e p c o n s i s t s o f o n e o r m o r e c h a r a c t e r s , a n d
characters specified in the same value step collate
equally. The first SEQS parameter specifies the
first value step or range of steps, the second SEQS
parameter specifies the second value step or range
of steps, and so on until your collating sequence
is completely defined. The following paragraphs
describe how to specify steps in your collating
sequence with SEQS parameters.
You can specify a single value step consisting of a
single character by a graphic character (see
appendix A) enclosed in apostrophes as in the
following example:
SEQS='A'
You can also specify a single value step consisting
of a single character by $CHAR(n) where n is the
number of the character in the character set at
your site (see table 3-1). The following example
specifies a step consisting of the character number
08 in the character set, which is the letter H:
SEQS=$CHAR(08)
You can specify a single value step consisting of
several characters by a single character enclosed
in apostrophes, followed by one or more characters
and/or ranges of characters. The characters are
enclosed in apostrophes. All characters specified
or implied in such a step collate equally. The
following example specifies a step consisting of
t h e b l a n k a n d t h e d i g i t s 0 , 1 , 2 , a n d 3 , a l l o f
which collate equally:
SEQS=(' ','0','1','2','3')
The following example species the same value step
a s a r a n g e o f c h a r a c t e r s w h e r e ' 0 ' . . ' 3 ' s p e c i e s
the range of digits from 0 through 3:
SEQS=(' ','0'..'3')
You can specify several value steps, each consist
ing of one character, with one value that is a
range of characters. The characters are enclosed
in apostrophes. The following example specifies a
four-step collating sequence consisting of the
digits 0, 1, 2, and 3, with 0 assigned the lowest
collating value:
SEQS=('0'..'3')
-/r^l\
TABLE 3-1. $CHAR(n) CHARACTER NUMBERS
Character CDC Graphic ASCII Graphic Octal
6-Bit Character CDC Graphic ASCII Graphic Octal
6 - B i t
Number (64-Charac (64 Charac Number (64-Charac (64 Charac
(decimal) t e r Se t ) t t e r S e t ) t Display
Code (decimal) ter Set)t ter Set)t Display
Code
00 00 32 40
01 01 33 41
02 02 34 42
03 03 35 43
04 04 36 44
05 05 37 45
06 06 38 46
07 07 39 47
08 10 40 50
09 11 41 51
10 12 42 52
11 13 43 53
12 14 44 £3 54
13 15 45 blank blank 55
14 16 46 56
15 17 47 57
16 20 48 // 60
17 21 49 61
18 22 50 62
19 23 51 63
20 24 52 64
21 25 53 65
22 26 54 66
23 27 55 67
24 30 56 70
25 31 57 71
26 32 58 72
27 33 59 73
28 34 60 74
29 35 61 75
30 36 62 —, 76
31 37 63 77
'For 63-chaicacter set differences, see the subsection entitled Charac.ter Set Anomal Les in appendix A
3-6 60484800 C
The preceding example is the same as specifying the
following:
SEQS='0'
SEQS='l'
SEQS='2'
SEQS='3'
You can specify several value steps, each of which
consists of more than one character, as ranges of
characters where each range has the same number of
characters. One value step in the collating
sequence results for each character implied by the
range. The characters are enclosed in apostro
phes. A diagnostic message is issued if each range
does not consist of the same number of characters.
T h e f o l l o w i n g e x a m p l e s p e c i e s a t h r e e - s t e p
collating sequence where the first step consists of
1 and A (which are assigned the lowest collating
value); the second step is 2 and B; the third step
is 3 and C:
SEQS=('1'..'3','A'..'C)
The preceding example is the same as specifying the
following:
SEQS=('1','A')
SEQS=('2','B')
SEQS=('3','C)
Any SEQS parameter that specifies a range of
characters followed by a single character results
in a fatal error. An apostrophe is specified in a
SEQS parameter by four apostrophes (""). You can
specify the SEQS parameter more than once in a
directive file. SEQS parameter use is summarized
in table 3-2.
You can use one SEQR parameter to define a special
value step that consists of all characters not
explicitly or implicitly specified with SEQS param
eters; either YES or Y is allowed. The following
example defines a sequence in which the digits
c o l l a t e i n n u m e r i c o r d e r, t h e n a l l s p e c i a l c h a r
acters (such as periods, commas, slashes) collate
equally, and then letters collate in alphabetic
order:
SEQS=('0'..'9')
SEQR=YES
SEQS=('A'..'Z')
You can specify one SEQA parameter to alter in
output records characters in the same value step to
the first character in the step; either YES or Y is
allowed. The following example alters all aster
isks and ampersands to slashes:
SEQS=(7\ '*','&')
SEQA=YES
Your collating sequence specification is terminated
by any parameter other than SEQS, SEQR, or SEQA.
You can define as many as 100 collating sequences
by specifying a separate series of SEQx parameters
for each collating sequence. The name of each
user-defined collating sequence in a sort or merge
must be unique. If you omit the SEQx parameters, a
nonstandard collating sequence is not defined.
STATUS
The STATUS parameter (figure 3-16) specifies that a
CYBER Control Language (CCL) variable be set to a
value representing the highest level of error that
occurred during the sort or merge. The CCL vari
ables Rl, R2, R3, RIG, EF, or EFG can be used for
this purpose. Table 3-3 shows values that can be
r e t u r n e d i n t h e s p e c i e d v a r i a b l e . F o r e x a m p l e ,
i f y o u s p e c i f y S TAT U S = R 1 a n d R l s u b s e q u e n t l y
contains 20, a trivial error occurred.
STATUS=variable (or ST=variable)
variable CCL variable R1, R2, R3, RIG, EF, or EFG.
Figure 3-16. STATUS Parameter Format
If you include the STATUS parameter in your sort or
merge specification, Sort/Merge does not abort if a
catastrophic error occurs before any data records
a r e i n p u t . H o w e v e r , i f S o r t / M e r g e c a l l s a n o t h e r
j4f$P*,\
00^\
TABLE 3-2. SEQS PARAMETER SUMMARY
Number of Value
Steps Specified by
One SEQS Parameter
1 step
1 step
More than one step
More than one step
Number of Characters
in Each Value Step
1 character
More than one
character
1 character
More than one
character
How Specified
Graphic character or $CHAR(n)
where n is the number of the char
acter in your character set.
Each character in the step is
enclosed in apostrophes and sepa
rated by commas, or a single char
acter is followed by one or more
ranges of characters.
One range of characters.
Ranges of characters where each
range has the same number of char
acters.
Example
SEQS='H' or
SEQS=$CHAR(08)
SEQS=('I','0','X') or
SEQS=(':','0'..'9')
SEQS=('0'..'9')
SEQS=('A'..'E',/V'..'Z')
60484800 C 3-7
TABLE 3-3. ERROR LEVEL CODES, STATUS PARAMETER
Error Level Code
No errors
Trivial 20
Warning 30
Fata l 40
Catastrophic 50
p r o d u c t a n d a n u n r e c o v e r a b l e e r r o r r e s u l t s , a n
abno r mal j ob t ermin a tion will occu r. For exam p l e,
if Sort/Merge called a product, such as Common
Memory Manager (CMM), and CMM processing results in
an error, a termination will occur. If you omit
the STATUS parameter, no error status variable is
set, and Sort/Merge aborts if a catastrophic error
occurs. The STATUS parameter can be abbreviated as
ST.
SUM
The SUM parameter (figure 3-17) specifies the
fields that are to be summed in records with equal
key values. Input files for a merge with summing
must be presorted and pre summed. As many as 255
bytes can be summed. The records with all key
fields equal are combined into one new record, and
the other records with equal keys are deleted. The
one resultant record contains the key fields and
the fields that are the sums of the specified
fields from all the records with equal keys; a data
eld t h a t is n o t a k e y eld o r a s u m eld is set
to the corresponding field from one of the old
records.
SUM = ((sum_def)[,(sum_def)] ...)
sum_def j (first.length [,type[,rep] ]) 1
[(range[,type[,rep]]) J
range ["first 1
[first., last J
first First byte or bit of the sum field.
last Last byte or bit of the sum field.
length Number of bytes or bits in the sum field;
default is 1.
type Name of a numeric data format (except
REAL); default is INTEGER.
rep Number of fields to be summed; default
is 1.
Figure 3-17. SUM Parameter Format
All the fields to be summed must contain numeric
data; otherwise, the contents of the new fields are
undefined. The fields described as sum fields
cannot also be key fields.
In figure 3-17, a sum_def describes a field to be I
summed by specifying the field length and position,
a numeric data format, and the number of fields to
be summed. The field length and position are the
first byte or bit of the field, and either the
number of bytes or bits in the field (length of the
e l d ) , o r t h e l a s t b y t e o r b i t o f t h e e l d . Yo u
specify first and length (or last) as integers; the
leftmost byte and the leftmost bit in a record are
counted as number 1. First and length (or last)
refer to bytes except for formats BINARY_BITS and
INTEGER_BITS. You must specify the first byte or
bi t of th e su m e ld. If you do no t sp e ci f y o t her
w i s e i n t h e S U M p a r a m e t e r , t h e s u m l e n g t h i s
assumed to be I; sum length can be a maximum of 17 I
bytes. I
Sum field type is the name of a numeric data format
except REAL; elds containing data in REAL format
cannot be summed. You must specify the sum field
type; no default exists. See section 2 for a list
of numeric data formats. The number of fields to
be summed is sp e c ied as an integer; the def a u l t
is 1. If you specify multiple fields with one SUM
parameter, the fields must be consecutive, must be
the same length, and must contain the same type of
numeric data* Sum fields cannot overlap one
another. If a sum field contains no data because a
record is short, the sum for that field is unde
fined. If you do not specify a sum type, the type
is assumed to be INTEGER.
Figure 3-18 shows an example of a SUM parameter.
Part A of figure 3-18 shows the layout of the
record containing the fields to be summed. Part B
shows three SUM parameters, each describing one
field to be summed. Part C shows one equivalent
SUM parameter that describes the three consecutive
fields to be summed. Note that when you specify a
single value-set, two sets of parentheses are still
required.
If the summing of the specified fields results in
new numeric values that do not fit into the sum
fields, a fatal error results. One of the records
that caused the overflow is deleted as usual, but
the sum eld contents in the remaining record are
undefined. A diagnostic message indicating which
field caused the overflow is issued, and the job
step is terminated at the end of the sort (unless
you include the STATUS parameter).
You can specify the SUM parameter more than once in
a directive file. If you omit the SUM parameter,
records with equal key values are not automatically
combined into single records. You cannot specify
both the SUM parameter and an owncode 5 routine for
the same sort or merge. You cannot specify both
the RETAIN parameter and the SUM parameter in the
same sort or merge. If you do specify both, a
catastrophic error occurs.
A*ms
A&$S
*mts
3-8 60484800 U
j0ms
A. Record Layout
1 1 0 1 5 2 0 2 5
Student number
(sort key)
Number of
units registered
Number of
units completed Grade points
B. SUM Parameters
SUM=((11,5.INTEGER))
SUM=((16,5,INTEGER))
SUM=((21,5,INTEGER))
C. SUM Parameter
SUM=((11,5,INTEGER,3))
Figure 3-18. SUM Parameter Example
0^^s VERIFY
The VERIFY parameter (figure 3-19) directs Sort/
Merge to check merge input records for correct
order. This parameter applies only if you are
performing a merge. If a merge input record is out
of order when you have specified VERIFY=YES, the
m e r g e i s t e r m i n a t e d ( r e g a r d l e s s o f t h e S TAT U S
parameter) and a diagnostic message is issued. If
VERIFY=N0, merge input records are not checked for
correct order. Omitting the VERIFY parameter is
equivalent to VERIFY=N0. You can specify VER
instead of VERIFY, and Y or N instead of YES or
NO. The VERIFY parameter is ignored if you are
performing a sort.
FASTIO=YES
FASTIO=NO
(or FASTIO=Y)
(or FASTIO=N)
Figure 3-20. FASTI O Parameter Format
If FASTI0=YES, all sort input and output files with |
block type C and record type F, or block type 1 and
record type W, are read directly by Sort/Merge. If
FASTI0=N0, all sort input and output files are |
processed using CRM. Omitting the FASTIO parameter
is equivalent to FASTI0=N0. You can specify Y or N
instead of YES or NO.
VERIFY=YES
VERIFY=NO
(or VER=Y)
(or VER=N)
Figure 3-19. VERIFY Parameter Format
FASTIO
The FASTIO parameter (figure 3-20) specifies that
I certain sort input and output records are to be
read and written directly by Sort/Merge rather than
by means of CYBER Record Manager (CRM). The FASTIO
parameter is ignored during a merge. Files
processed by the FASTIO parameter must reside on
mass storage. The records in these files must be
block type C and record type F, or block type I and
record type W (see the CRM Basic Access Methods
reference manual for detailed information). All
input files must have identical record types and
record lengths. If the file resides on tape, or if
the records are not ail the same type and length, a
warning diagnostic is issued and the FASTIO option
is canceled. The files are then processed using
CRM. Sort/Merge obtains block and record type
information from the file information table (FIT);
a FILE control statement is not ignored.
Specifying the FASTIO parameter results in
increased speed, but not all errors are diagnosed;
use this parameter when you are sure your files are
correctly written and described.
SPECIFYING PARAMETERS
BY POSITION
You can specify any of the Sort/Merge parameters in
a control statement or in a directive file without
a keyword by supplying a value in the position
assigned to that particular keyword. Table 3-4
lists the parameter keywords and the position
assigned to each. Omitted parameters are replaced
by commas. For example, the following control
statements are equivalent:
S0RT5.INFL,0UTFL,5..9,,,,F
SORTS.FR0M=INFL,T0=0UTFL,KEY=5..9,EL=F
The two preceding control statements specify that
records to be sorted are in the file 1NFL, and
sorted records are to be written to file OUTFL.
T h e s o r t k e y e l d b e g i n s w i t h t h e f t h c h a ra c t e r
of each record, and the last character of the key
field is the ninth character of the record. Fatal
and catastrophic errors are to be reported.
You can mix keyword specification and positional
specification of parameters in the same control
statement or directive file. whenever you specify
a parameter with a keyword, the parameter retains
its position number (table 3-4). Any positional
parameters you specify after a keyword parameter
are numbered according to the position number of
60484800 D 3-9
TABLE 3-4. PARAMETER POSITIONAL ORDER
Parameter Position
Keyword Number
FROM
TO
KEY
DIR
L
Reserved for
future use
E
EL
DIALOG
ENR 10
Reserved for 11
future use
Reserved for 12
future use
OWNF 13
OWNFL 14
OWNMRL 15
Reserved for 16
future use
0WN1 17
0WN2 18
0WN3 19
0WN4 20
0WN5 21
RETAIN 22
SEQA 23
SEQN 24
SEQR 25
SEQS 26
STATUS 27
SUM 28
Reserved for 29
future use
VERIFY 30
FASTIO 31
the last keyword parameter you specified. The
following example illustrates mixing keyword and
positional parameters:
S0RT5.DIR=DIRFIL,,,,,,6000,RET=Y,,,,,EFG
The DIR parameter is position number 4. Commas
replace parameters 5 through 9. The estimated
number of records (6000) is position number 10.
Numbering begins again with a keyword parameter
(RETAIN number 22). Commas replace parameters 23
through 26. The positional value EFG is the status
variable (STATUS number 27).
FILE CONTROL STATEMENT
Unless default characteristics apply for a file,
you must specify the characteristics of all input
and output data files named in a S0RT5 or a MERGE
control statement, or in a directive file, with a
CYBER Record Manager (CRM) FILE control statement.
FILE control statements must precede the S0RT5 or
th e M E R GE c o n t r o l st a t e m e n t . T h e fo rm at o f t h e
FILE control statement is shown in figure 3-21.
/^^%V
FILE{rm[,keyword=option] . . . )
l f n L o g i c a l l e n a m e ; 1 t o 7 l e t t e r s o r
digits, beginning with a letter.
keyword-option Symbolic name of the file information
table (FIT) field and the option
selected.
Figure 3-21. FILE Control Statement Format
The file information table (FIT) is a table through
which file characteristics are communicated to CRM
Basic Access Methods; the FIT contains information
that describes the file and specifies how the file
is accessed. You set FIT fields by specifying the
s y m b o l i c n a m e o f t h e e l d i n t h e F I L E c o n t r o l
statement and selecting one of the options associ
ated with that field. Several FIT fields important
to Sort/Merge processing are discussed in the
following paragraphs. The CRM Basic Access Methods
reference manual contains a complete list of all
FIT fields and options that you can select. Note
that specification of certain FIT fields can
require setting of additional FIT fields.
I n p u t l e s t o b e s o r t e d o r m e r g e d , a n d o u t p u t
files to which sorted or merged records are writ
ten, must be sequential files (records are read and
written in order one after the other). The file
organization (FO) FIT field can be included in the
FILE control statement and sequential organization
specified (F0=SQ); you can omit this parameter and
sequential organization is assumed.
Sequential files are organized into groups of
records called blocks. Block type is specified
with the block type (BT) FIT field. The default is
BT= C . C R M a l so o ff ers sev e ral reco r d t y pes , an d
any of these record types except U can be sorted or
merged. Record type is specified with the record
type (RT) FIT field. The default is RT=Z. The
full length (FL) or maximum record length (MRL) FIT
eld must be set to establish the number of char
a c t e r s i n a r e c o r d . T h e d e f a u l t i s F L = 1 5 0 o r
/^^%.
3-10 60484800 D
MRL=150. The default is also a satisfactory
description for records of less than 150 char
acters. If you have any files of considerably less
than 150 characters (25 characters for example),
Sort/Merge can perform more efficiently if you
include a FILE control statement.
Default CRM characteristics apply for the files
INPUT, OUTPUT, and PUNCH. You do not need to
include FILE control statements for these files.
Table 3-5 summarizes the default file characteris
t i c s f o r S o r t / M e r g e i n p u t a n d o u t p u t d a t a l e s ,
directive files, the error and listing files, and
the files INPUT, OUTPUT, and PUNCH.
SPECIFYING MAXIMUM
RECORD LENGTH
Unless default characteristics apply for a file,
Sort/Merge requires that you specify maximum record
length for input and output data files. You
specify maximum record length by setting the FL or
MRL FIT field in the FILE control statement. Set
the FL FIT field for F or Z type records to specify
the length o f each record (i f RT = F ) , or the up p e r
li mi t o f ch ar ac te rs i n a r e c o r d ( if RT = Z ) . F o r a ll
other record types, set the MRL FIT field to
specify the maximum length of a record.
taneously open. The default file buffer size (BFS)
is 2001 g words. You can change this value with
FILE control statement to save memory.
TABLE 3-5. FILE CHARACTERISTICS
> w F I T
^sField BT RT FL
File ^"s.
FROM files FL<150
TO l e FL<150
DIR files FLO00
L fi l e FL=132
E l e FL=72*
INPUT FL=80
OUTPUT FL=»140
PUNCH FL=80
'If E=0UTPUT, FL=140 is used.
FIELD LENGTH REQUIREMENTS
Large sort or merge operations can require
additional central memory. The memory needed for a
merge is directly proportional to the number of the
input files you have, because all files are simul-
LISTINGS
If an error occurs during the sort or merge, the
message S0RT5 - USER ERROR, JOB ABORTED is sent to
your job dayfile. Otherwise, when the sort or
merge is complete, a message indicating the number
of records sorted or merged is sent to the dayfile.
r60484800 D 3-11
INTERACTIVE USE
Sort/Merge capabilities are available interac
tively; you can specify any of the Sort/Merge
parameters from your terminal. Sort/Merge also
p r o v i d e s a t u t o r i a l d i a l o g t o a i d i n s p e c i f y i n g
parameters. This section describes the use of this
dia l og, S ort/Merg e inte ractive comma n ds, a n d log in
and logout processes. The complete text of the
dialog is included in appendix E.
In interactive mode, control statements cannot be
continued on more than one line. Instead, you can
either create a directive file or use a procedure
file so you can use a text editor to verify or
change complex sort specifications.
PASSWORD:
E n t e r t h e 4 - t o 7 - c h a r a c t e r p a s s w o r d
assigned to you to provide access security;
some terminals overtype to preserve privacy.
termnam-APPLICATION:
E n t e r I A F ( f o r I n t e r a c t i v e F a c i l i t y , t h e
network software that provides you with the
time- s h a ring capabi l i ties o f NO S ) ; te r m n am
represents the terminal identification.
JSN: zzzz, NAMIAF
CHARGE NUMBER:
yms
TERMINAL ACCESS TO
SORT/MERGE
To access Sort/Merge from your terminal, you first
e s t a b l i s h t h e p h y s i c a l c o n n e c t i o n b e t w e e n t h e
terminal and the computer. The method of estab
lishing the connection varies depending on the type
of terminal and the coupling between the terminal
and computer. Consult the NOS Version 2 Reference
Set, Volume 1 (for NOS users) or the INTERCOM
reference manual (for NOS/BE users) for information
on connection methods.
Connecting your terminal to the computer initiates
the login process. The operating system, either
NOS or NOS/BE, identifies itself to you, and you
must supply information that indicates you are a
valid system user.
LOGGING IN UNDER NOS
The login procedure to NOS begins with initial
information from the system (including date, time,
terminal name, installation name, and operating
system version). The second line of this informa
tion is dependent on the installation. You are
then prompted to enter information to indicate you
are a valid system user. The prompts and required
responses are as follows:
FAMILY:
JSN: zzzz, NAMIAF
READY.
If a charge number is requested, enter your
assigned charge number and project number.
The system will then respond with READY.
The login procedure is now complete. You
can then enter the batch subsystem. Do not
change to ASCII mode since Sort/Merge does
not process data in this mode.
Figure 4-1 shows an example of a NOS login. You
are now ready to perform sort or merge operations
as de s c r i b e d later i n this s e c t i on.
82/01/08. 10.42.16. T143A
CDC NOS 2
FAMILY:
USER NAME: xxxxxxx
PASSWORD: xxxx
T143A - APPLICATION: iaf
JSN: AADI, NAMIAF
CHARGE NUMBER:
? $X*@ftK
PROJECT NUMBER:
READY,
/batch
RFL,0.
/
Figure 4-1. NOS Login Example
00"*S
Enter the family name of the mass storage
device that contains your permanent files.
Some installations do not request a family
name; the family name is the default family
for the system.
USER NAME:
Enter the user name assigned to you by your
system administrator.
LOGGING IN UNDER NOS/BE
As soon as your terminal is connected to the
system, the system responds with a message indi
cating date, time, and the INTERCOM version number
(INTERCOM is the software that directs the flow of
data between your terminal and the central site
computer). The system requests the following:
PLEASE LOGIN
60484800 B 4-1
Enter LOGIN. You are then prompted for validation
information. The prompts and required responses
are as follows:
ENTER USER NAME-
Enter the user name assigned to you by your
system administrator.
J3GSmQQQQCKX ENTER PASSWORD-
Enter the password (up to 10 letters and
digits) assigned to you to provide access
security; some terminals overtype to pre
serve privacy.
When the user number and password are accepted, a
2-character user code and the login time, followed
by the equipment number and port number, are dis
played or printed at your terminal. The message
COMMAND- appears, indicating the login process is
complete. Figure 4-2 shows an example of NOS/BE
login. You are now ready to perform sort or merge
operations as described in the following subsection.
CONTROL DATA INTERCOM 5.0
D AT E 0 1 / 2 3 / 8 1
TIME 09.35.50.
PLEASE LOGIN
Login
ENTER USER NAME-sort
HtiMftttfcnr ENTER PASSWORD-
01/23/81 LOGGED IN AT 09.36.23.
WITH USER-ID OK
EQUIP/PORT 63/076
LOGIN CREATED 01/21/81 TODAY is 01/23/81
C0MMAND-
Figure 4-2. NOS/BE Login Example
INTERACTIVE DIALOG
Sort/Merge provides an interactive dialog to aid In
specifying parameters. The tutorial dialog is
designed to guide you, step by step, through your
sort or merge specification. You can specify any
control statement sort or merge, including a sort
or merge with owncode routines and a nonstandard
collating sequence, using the interactive dialog.
After login is complete, and before beginning the
dialog, you must assign any files used in your sort
or merge (files containing input records to be
sorted, owncode routines, or presorted files to be
merged) to your terminal with an ATTACH command or
the equivalent. You must enter CYBER Record Man
ager (CRM) FILE control statements for any of your
files that are not written in standard unit record
format. Standard unit record format files include
files created by punched cards in a batch job or
li ne s e n t e r e d a t a t er mi na l, a n d th e s p e c i a l le s
INPUT, OUTPUT, and PUNCH. CRM defines these files
as block type C (BT=C) and record type Z (RT=Z).
Sort/Merge assumes each record contains 150 char
acters or less. If you have any files of consider
ably less than 150 characters (25 characters for
example), Sort/Merge can perform more efficiently
i f y o u e n t e r a F I L E c o n t r o l s t a t e m e n t . S e e y o u r
operating system reference manual for information
about retrieving permanent files and the CRM Basic
Access Methods reference manual for information
about FILE control statements.
For NOS/BE users, Sort/Merge automatically connects
and disconnects files INPUT and OUTPUT; Sort/Merge
writes the dialog to OUTPUT, which is displayed or
printed at your terminal. Your dialog responses
are read from INPUT.
NOTE
Before entering a S0RT5 or MERGE command
with the DIALOG parameter, ensure that
your terminal is in normal mode by enter
ing the NORMAL terminal command. If your
terminal is in ASCII mode during the
interactive dialogue, Sort/Merge cannot
recognize your responses unless you enter
them using uppercase letters only.
If you are already in the dialog, and need
to change the terminal mode, enter a
control-T to return to the system.
The interactive dialog begins when you type
S0RT5.DIAL0G=YES or MERGE. DIALOG=YES. Any other
parameters (except STATUS) that you enter along
with DIALOG are ignored. During the dialog, Sort/
Merge asks various questions, one at a time, and
your response to each question determines the next
question. For example, Sort/Merge asks if you have
just one input file and no 0WN1 or 0WN2 subrou
tines. If you enter YES, the next question requests
the name of your input file. If you enter NO, the
next question asks if you have an 0WN1 subroutine.
The expected response to each question is evident
from the question. For example, one question asks
how many key fields you have; you enter a number.
For questions requiring yes or no answers, you can
type YES or Y, or NO or N. If you make a mistake
(misspell the word yes, for example), Sort/Merge
gives you an explanation of the expected answer and
asks the question again. If you enter an incorrect
answer a second time, Sort/Merge asks you if you
want help. If you type YES, an explanation of
Sort/Merge usage is displayed or printed at your
terminal. If you do not want help and type NO, the
original question is repeated. Figure 4-3 shows an
example of this sequence.
The last question Sort/Merge asks is how many
r e c o r d s a r e t o b e s o r t e d o r m e r g e d . A f t e r y o u
en te r t h e a p p r o p r i a t e nu m b e r, So rt /M e r g e in fo rm s
you that the sort or merge you have specified is
beginning. When the sort or merge is complete,
control of your terminal is returned to the oper
ating system; the operating system prompt for input
appears (/ under NOS, COMMAND- under NOS/BE).
/<^K
4-2 60484800 D
>^*v
/sort5.dialog=yes-*
IS YOUR TERMINAL ALREADY SET TO NORMAL MODE OR UPPERCASE
ASCIII MODE. ALSO, ARE YOU SURE THAT ALL YOUR FILES (IF ANY)
ARE EITHER STANDARD UNIT RECORD FORMAT OR HAVE HAD FILE
CONTROL STATEMENTS SPECIFIED FOR THEM
? yes
DO YOU HAVE JUST ONE INPUT FILE AND NO OWN1 OR OWN2 SUBROUTINES
? no
DO YOU HAVE AN OUN1 SUBROUTINE
? y g « » t i .
DO YOU HAVE AN OWN1 SUBROUTINE ** .
? y s e - * .
Begin interactive dialog.
DO YOU WANT HELP
? y
SINCE YOU DID NOT SAY "NO" YOU ARE GOING TO BE HELPED. **
IS THE SAME AS 'YES' AND 'N' IS THE SAME AS 'NO'.
TYPE 'RESTART' TO GO BACK TO THE BEGINNING.
TYPE 'QUIT' TO STOP RUN.
THE OWN1 ROUTINE CAN BE USED TO PROCESS INPUT RECORDS. A DETAILED
OF THIS OWNCODE ROUTINE IS IN THE SORT/MERGE REFERENCE MANUAL.
DO YOU HAVE AN OWN1 SUBROUTINE^ .
? yse
DO YOU HAVE AN OWN1 SUBROUTINE
? yse
DO YOU WANT HELP
? no
DO YOU HAVE AN OWN1 SUBROUTINE-*
? yes
Incorrect response.
Question asked again.
Second incorrect response.
Help after second incorrect response.
DESCRIPTION
- Question asked again.
No help after second incorrect
response; question asked again.
Figure 4-3. Incorrect Response Example
If sorted or merged records are written to a file
(not processed by an owncode routine), Sort/Merge
creates a local file and gives this file the name
you entered in response to the question "What is
the name of your output file?" Upon completion of
the sort or merge, you can display or print this
file at your terminal, or route the file to a
p r i n t e r t o b e l i s t e d . I f y o u w a n t t o u s e t h e l e
at a later time, you must save it as a permanent
file before logging out; otherwise, the file is
lost. Figure 4-4 shows an example of output file
disposition.
After the explanation, the question Sort/Merge
asked you immediately before you entered the HELP
command is asked again, resuming the dialog.
RESTART
If you type RESTART, the interactive dialog is
started over at the beginning. All. previous
answers to questions are discarded. You can use
this command if you give Sort/Merge incorrect
information such as the wrong number of key fields.
INTERACTIVE COMMANDS QUIT
Several commands exist to control the use of the
interactive dialog. These commands are HELP,
RESTART, and QUIT. A command can be entered at any
time during the dialog, but HELP, RESTART, and QUIT
cannot be the names of user-supplied entities such
as files and collating sequences. Use of the
commands is described in the following paragraphs.
HELP
If you type QUIT, the interactive dialog is ter
minated. The sort or merge is not performed, and
control of your terminal is returned to the oper
ating system. You can then perform other terminal
operations or logout. If permanent files con
t a i n i n g i n p u t r e c o r d s t o b e s o r t e d o r m er g e d , o r
owncode routines have been assigned to your job,
you should release these les by using the RETURN
c o m m a n d ( s e e y o u r o p e r a t i n g s y s t e m r e f e r e n c e
manual)*
If you type HELP, an explanation of Sort/Merge
u s a g e i s d i s p l a y e d o r p r i n t e d a t y o u r t e r m i n a l .
Figure 4-5 shows an example of interactive command
use*
60484800 D 4-3
/sort5.dialog=yes
WHAT IS THE NAME OF YOUR OUTPUT FILE
? s r t o u t «
THANK YOU SORT/MERGE NOW BEGINS.
SORT5.diaLog=YES—
/copysbf,srtout,output -*-
1REYES
MAYER
CHARLES
MARTIN
NEECE
S L 100246031558ANTHRO
M I 100991122359ANTHR0
S H 101418032459ANTHR0
R C 100955082157ART
M L 99911121358ART
Begin interactive dialog.
Local file created for sorted output.
Dialog completion; sort begins.
NOS repeats control statement (up to 48 characters)
Display or print sorted file.
L A S E U R P T
SUGARMAN B T
S M I T H F R
DOUGLAS M L
O K A D A N A
EOI ENCOUNTERED,
/rewind,srtout
REWIND,SRTOUT.
/copysbf,srtout,myfi I
EOI ENCOUNTERED,
/route,myf i L,dc=pr -*-
ROUTE COMPLETE,
/save,srtout
100678042256PSYCH
100528070457SOC
101062120758SOC
101325071558UNDEC
100103111750UNDEC
3341
2382
2453
2891
2291
2233
3501
2913
2585
2225
File SRTOUT.
Copy sorted file to be listed by printer.
Route copy of sorted file to printer.
Make sorted file a permanent file.
Figure 4-4. Output File Disposition Example
I *-* 60484800 D
jm&s
/sort5.dia Log=yes Begin interactive dialog.
Dialog started over
at beginning.
IS YOUR TERMINAL ALREADY SET TO NORMAL MODE OR UPPERCASE
ASCII MODE. ALSO, ARE YOU SURE THAT ALL YOUR FILES (IF ANY)
ARE EITHER STANDARD UNIT RECORD FORMAT OR HAVE HAD FILE
CONTROL STATEMENTS SPECIFIED FOR THEM
? y
YOU HAVE JUST ONE INPUT FILE AND NO OWN1 OR 0WN2 SUBROUTINES
? n
DO YOU HAVE AN OWN1 SUBROUTINE
? y
WHAT IS THE NAME OF THE FILE CONTAINING YOUR OWNCODE SUBROUTINE(S)
? myrthns
WHAT IS THE NAME OF YOUR OWN1 SUBROUTINE
? restart-* Command entered.
IN RESPONSE TO YOUR REQUEST RESTART HAS BEEN INITIATED.
IS YOUR TERMINAL ALREADY SET TO NORMAL MODE OR UPPERCASE )
ASCII MODE. ALSO, ARE YOU SURE THAT ALL YOUR FILES (IF ANY)
ARE EITHER STANDARD UNIT RECORD FORMAT OR HAVE HAD FILE
CONTROL STATEMENTS SPECIFIED FOR THEM
? y
DO YOU HAVE JUST ONE INPUT FILE AND NO OWN1 OR OWN2 SUBROUTINES
? n
DO YOU HAVE AN OWN1 SUBROUTINE
? y
WHAT IS THE NAME OF THE FILE CONTAINING YOUR OWNCODE SUBROUTINE(S)
? ownsrtn
WHAT IS THE NAME OF YOUR OWN1 SUBROUTINE
? myrtn
DO YOU HAVE AN 0WN2 SUBROUTINE
? h e l p Command entered.
*Y' IS THE SAME AS 'YES' AND 'N' IS THE SAME AS 'NO'. ^
TYPE 'RESTART' TO GO BACK TO THE BEGINNING. J
TYPE 'QUIT' TO STOP RUN. > USa9e ..
THE OWN2 ROUTINE CAN BE USED TO PROCESS INPUT FILES. A DETAILED DESCRIPTION 1 exPlanar,on
OF THIS OWNCODE ROUTINE IS IN THE SORT/MERGE REFERENCE MANUAL. /
DO YOU HAVE AN 0WN2 SUBROUTINE
? quit-* Conmand entered.
sort/merge is quitting.-* Sort/Merge terminated.
Figure 4-5. Interactive Command Example
r60484800 D 4-4.1/4-4.2
SPECIFYING PARAMETERS
INTERACTIVELY
You can specify any of the Sort/Merge parameters
from your terminal in a S0RT5 or MERGE control
statement. After you login, assign all necessary
files (including directive files) to your job, and
type in FILE control statements for files with
other than default characteristics. You enter
S0RT5 or MERGE followed by parameters In one of the
following forms:
S0 RT5 .p l , p 2 , . .. ,p n
MERGE.plA p2A ...A pn
In the preceding example, p represents a processing
parameter. Parameters must be separated by commas
or spaces; commas and spaces can be used inter
changeably. You can enter the control statement
and parameters in input line character positions 1
through 80. If your sort or merge specification Is
longer than 80 characters, you must use a directive
file for the additional parameters.
Figure 4-6 shows an example of specifying param
eters interactively.
LOGGING OUT
To end your terminal session, you type GOODBYE,
BYE, or LOGOUT if you are using the Interactive
Facility of NOS. If you are using INTERCOM under
NOS/BE, you type LOGOUT. Under either system, a
message indicating that you are logged out is dis
played or printed at your terminal.
0^S
/attach,univer -*
/file(univer,bt=c,rt=z,fl=38)
FILE(UNIVER,BT=C,RT=Z,FL=38)
/file(oout,bt=c,rt=z,f1=38) \
FILE(00UT,BT=C,RT=Z,FL=38) ;
/sort5.from=univer,to=oout,key=((35,3,asci i6,d)) -*
S0RT5.FR0M=UNIVER,T0=00UT,KEY=((35,3,ASCI16,D))
Input file assigned to the job.
FILE control statements for input
and output files because records
are only 35 characters in length.
-- S0RT5 control statement entered.
NOS repeats control statement
(up to 48 characters).
— Control returns to NOS operating system.
Figure 4-6. Interactive Parameter Specification Example
i0&s.
60484800 B 4-5
r%
PROCEDURE CALLS
0?*^.
So r t/ M er g e a ls o e x is t s a s a s e t o f p ro c ed ure s; a
sort or merge can be invoked from within a program
by a sequence of procedure calls. The procedures
can be called from FORTRAN or by a program in any
language that uses the standard FORTRAN calling
sequence. The same type of Sort/Merge processing
is available through the procedures as is available
through the S0RT5 or the MERGE control statement;
t h e p r o c e d u r e c a l l s c l o s e l y c o r r e s p o n d t o t h e
Sort/Merge parameters. This section describes the
procedure calls; COBOL programmers should see
section 6 for information on calling the procedures.
All conventions for coding FORTRAN statements must
be observed in procedure calls (see the FORTRAN 5
reference manual). You must assign any permanent
files named in procedure calls to your job with an
ATTACH command (or the equivalent) in the control
statement section of the job. The procedures
cannot be used in a static memory management
environment. A merge could require twice as much
mass storage for intermediate merge files as is
required for the merge input files.
All files to be sorted, or presorted files to be
me r g e d , mu st b e s e q u e n t i a l l e s . T he d e f au lt l e
characteristics are block type C, record type Z,
and full length of 150 characters or less. For
files with other block types and record types, you
must include CYBER Record Manager (CRM) FILE
control statements in the control statement section
of your job. See the CRM Basic Access Methods
reference manual for information on block types and
record types.
The procedures can be called in any order with two
exceptions: SM5S0RT or SM5MERG must be the first
procedure called, and SM5END must be the last
procedure called. Sort/Merge collects processing
information until SM5END is called; the sort or
merge is then performed. Unless stated otherwise,
a procedure can be called only once during a sort
or merge. Refer to section 7 for information on
owncode routines, which are mentioned in the
descriptions of several of the procedures.
SM5SORT
Execution of the SM5S0RT procedure signals the
b e g i n n i n g o f a s o r t s p e c i c a t i o n . T h e S M 5 S 0 R T
procedure must be the first procedure called for a
so rt. The format of the SM5S0RT ca ll i s sh own in
figure 5-1.
CALL SM5SORT(option)
option Result array name (1 to 7 letters or digits,
beginning with a letter) or the integer 0.
s t a t i s t i c s a n d r e s u l t s t o y o u r p r o g r a m w h e n t h e
sort is completed. You set the first element of
the result array to the number of elements (as many
as 15) in which you want to receive information.
If you set the first element to 0 or specify CALL
SM5SORT(0), no statistics or results are returned.
The type of result that is returned in each element
is shown in table 5-1.
TABLE 5-1. RESULT ARRAY FORMAT
Figure 5-1. SM5SORT Format
The array associated with the SM5S0RT procedure is
a 16-element integer array that returns sort
Array
Element
Number
Contents
1Number of elements of results
you want returned (0 through
15)
2Number of records read from
sort or merge input files
3Number of records deleted by
an owncode 1 routine
4Number of records inserted by
an owncode 1 routine
5Number of records inserted by
an owncode 2 routine
6Number of records sorted or
merged
7Number of records deleted by
an owncode 3 routine
8Number of records inserted by
an owncode 3 routine
9Number of records inserted by
an owncode 4 routine
10 Reserved
11 Number of records deleted by
an owncode 5 routine
12 Number of records combined by
summing
13 Number of records written to
o u t p u t l e
14 Minimum record length in
characters
15 Average record length in
characters
16 Maximum record length in
characters
60484800 A 5-1
SM5MERG
Execution of the SM5MERG procedure signals the
beginning of a merge specification. The SM5MERG
procedure must be the first procedure called for a
merge. The format of the SM5MERG call is shown in
figure 5-2.
CALL SM5MERG(option)
option Result array name (1 to 7 letters or digits,
beginning with a letter) or the integer 0.
Figure 5-2. SM5MERG Format
The input files for a merge must be presorted.
Input files for a merge with summing must be
presorted and presummed.
The array asociated with the SM5MERG procedure is a
16-element integer array that returns merge statis
tics and results to your program when the merge is
complet e d . You set the rst e l e ment of the r e s u l t
array to the number of elements (as many as 15) in
which you want to receive information. If you set
the first element to 0 or specify CALL SM5MERG(0),
no statistics or results are returned. The type of
result that is returned in each element is shown in
table 5-1. Note that the array is not set by Sort/
Merge until the end of the merge.
SM5FROM
Execution of the SM5FR0M procedure specifies the
input les from which the records to be sorted or
merged are read. The format of the SM5FR0M call is
shown in figure 5-3.
CALL SMSFROMCfilel'I/file?:
'file' File name; 1 to 7 letters or digits, beginning
with a letter.
Figure 5-3. SM5FROM Format
Yo u c a n s p e c i f y a s m a n y a s 1 0 0 l e s w i t h o n e
SM5FR0M procedure, or you can call the SM5FR0M
procedure as many as 100 times. The files are read
in the ord e r t h at you spe c ify the m ; a l e ca n not
be specified more than once for a merge. The files
are rewound before and after use unless the name of
the file is INPUT or a FILE control statement
parameter specifies otherwise. If a file is open
when Sort/Merge is called, it is not rewound after
use because the CF value in the FIT is undetermined.
Sort/Merge assumes that the les you specify with
the SM5FR0M procedure are CRM block type C and
record type Z with FL of 150 characters or less.
If you specify files that have different character
istics, you must describe these files to Sort/Merge
by including FILE control statements in the control
statement section of your job. You should open the
FROM les before doing a sort or merge to be sure
that Sort/Merge gets passed the correct file
attributes. The files are not read past embedded
e n d - o f - r e c o r d o r e n d - o f - l e m a r k s ( s e e t h e C R M
Basic Access Methods reference manual).
If the SM5FR0M procedure is not called, records to
be sorted are read from the file OLD (unless an
owncode routine supplies records). An empty
SM5FR0M file results in a null sort. The SM5FR0M
file cannot be the same as the SM5T0 file.
SM5TO
Execution of the SM5T0 procedure specifies the file
to which sorted or merged records are written
(unless an owncode routine processes all records).
The format of the SM5T0 call is shown in figure 5-4.
CALL SM5TOCfile')
'file' File name; 1 to 7 letters or digits, beginning
with a letter.
Figure 5-4. SM5TO Format
The le is not rewound before or after use unless
the name of the file is OUTPUT or a FILE control
statement parameter specifies otherwise. Sort/
Merge assumes that the file you specify with the
SM5T0 procedure is CRM block type C and record type
Z with FL of 150 characters or less. If you
specify a file with different characteristics, you
must describe the le to Sort/Merge by including a
FILE control statement in the control statement
section of your job. You should open the TO file
before doing a sort or merge to be sure that
Sort/Merge gets passed the correct le attributes.
S o r t / M e r g e w r i t e s t h e l e d i r e c t l y, a n d t h e l e
i s c l o s e d w h e n t h e s o r t o r m e r g e i s c o m p l e t e d
unless the name of the file is INPUT. If your
program also reads or writes the file, you must
include an OPEN or REWIND statement in your program
after calling the procedures. If the SM5TO proce
dure is not called, records are written to the file
NEW (unless an owncode routine processes all
records). The SM5T0 file cannot be the same as the
SM5FR0M file.
SM5KEY
E x e c u t i o n o f t h e S M 5 K E Y p r o c e d u r e s p e c i e s a
single key field for the sort or merge. The format
of the SM5KEY call is shown in figure 5-5.
CALL SMSKEYffirst.length.'typeVad')
first First byte or bit of the key field.
length Number of bytes or bits in the key field.
'type' Name of a numeric data format or collating
sequence.
'ad' Order, either 'A' for ascending or 'D' for
descending.
Figure 5-5. SM5KEY Format
5-2 60484800 D
J0&S
In the SM5KEY procedure call, you specify the first
byte or bit of the key eld, the length of the
field in bytes or bits, the key type (the name of a
collating sequence or a numeric data format), and
the sort order. You must specify the key charac
teristics in the order shown.
You specify first and length as integers; the
leftmost byte or bit in a record is counted as
number 1. For character data, each character is
six bits and occupies one byte. For numeric data,
first and length refer to bytes except for formats
BINARY_BITS and INTEGER_BITS. You must specify the
rst byte or bit of a key eld. If you do not
specify the length, length defaults to 1.
The key type is the name of a predefined collating
sequence or your own collating sequence defined by
SM5SEQx procedures, or the name of a numeric data
format. The name must be enclosed in apostrophes.
The default type is the ASCII6 collating sequence.
See section 2 for a list of predefined collating
sequences and numeric data formats.
The sort order is either ascending or descending,
and you specify 'A' or 'D', respectively. The
default order is ascending. For numeric keys
sorted in ascending order, the record having the
key with the highest value is written last on the
output file. Ascending character keys are sorted
according to the collating sequence you specify.
For numeric keys sorted in descending order, the
record having the key with the lowest value is
written last on the output file. Descending
character keys are sorted in reverse order of the
collating sequence you specify.
You can call the SM5KEY procedure as many as 100
times during a sort or merge to specify multiple
sort keys. Output records are sorted or merged
according to the key field described by the first
SM5KEY procedure called, then according to the key
field described by the second SM5KEY procedure
called, and so on. The total number of key char
acters must be less than 256 (if you also specify
sum fields, the total number of characters in the
key and sum elds together must be less than
256). Unless the SM5SEQA procedure is used, key
fields can overlap one another. If the SM5KEY
procedure is not called, the entire record is used
as a character key field, and the default key type
and sort order are used.
SM5E
Execution of the SM5E procedure specifies the file
to which diagnostic messages are written. The
format of the SM5E call is shown in figure 5-6.
CALL SM5E('file')
'file' File name; 1 to 7 letters or digits, beginning
with a letter.
Figure 5-6. SM5E Format
The file is written in CRM BT=C, RT=Z, and FL=72
f o r m a t . T h e l e i s n o t r e w o u n d b e f o r e o r a f t e r
use unless a FILE control statement parameter
s p e c i e s r e w i n d . I f t h e S M 5 E p r o c e d u r e i s n o t
call e d, d i agno s tic m essa g e s a r e w r i tten to t he l e
OUTPUT. If you specify the file $NULL with the
SM5E procedure, diagnostic messages are not written.
SM5EL
Execution of the SM5EL procedure specifies the
error level to be reported. The format of the
SM5EL call is shown in figure 5-7.
CALL SM5EL(error-level)
error-level Alphabetic character enclosed in apostrophes
or integer (see table 5-2).
Figure 5-7. SM5EL Format
The error levels that you can select are shown in
tab l e 5 - 2. Yo u c an s peci f y t h e a l pha b eti c ch a rac
ter enclosed in apostrophes or the integer. For
example if you specify 'W' or 2, any warning,
fatal, and catastrophic error messages are re
ported. Errors are written to the file specified
by the SM5E procedure or, if the SM5E procedure is
n o t c a l l e d , t o t h e l e O U T P U T. I f t h e S M 5 E L
procedure is not called, errors of levels T, W, F,
and C are reported. See appendix B for an explana
tion of the four levels of errors.
TABLE 5-2. ERROR LEVEL SPECIFICATION
Error Level Errors Reported
'T' or 1
'W or 2
'F' or 3
'C or 4
T, W, F, C
W, F, C
F, C
C
SM5ENR
Execution of the SM5ENR procedure specifies the
estimated number of records to be sorted or
merged. The format of the SM5ENR call is shown in
figure 5-8.
CALL SM5ENR(integer)
integer Number of records to be sorted or merged;
0 to 1000000000.
Figure 5-8. SM5ENR Format
The integer you specify is the approximate number
of records to be sorted or merged. If SM5ENR is
specified as less than 1500, Sort/Merge uses less
memory for the initial sort phase. This causes
no ticeably less memory required for the entire sort
if the actual number of records is a low number.
60484800 D 5-3
SM5FAST
Execution of the SM5FAST procedure can specify that
certain sort input and output records are to be
read and written directly by Sort/Merge rather than
by means of CYBER Record Manager (CRM). The
SM5FAST procedure is ignored during a merge. The
format of the SM5FAST call is shown in figure 5-9.
CALL SM5FAST(option)
option 'YES' or 'Y'
IN©' or 'N'
Figure 5-9. SM5FAST Format
T h e op t i o n c a n b e 'Y E S ' o r ' N O ' (o r 'Y ' or ' N ' ).
| I f t h e o p t i o n i s ' Y E S ' , c e r t a i n s o r t i n p u t a n d
output records are read and written directly by
Sort/Merge. If the option is 'NO', CRM is used.
Fi l es pr o ce s se d b y t h e S M5 FA ST p r oc edu re mu s t
reside on mass storage. The records in these files
must be block type C and record type F, or block
type I and record type W (see the CRM Basic Access
Methods reference manual for detailed infor
m a t i o n ) . A l l i n p u t l e s m u s t h a v e a n i d e n t i c a l
re c or d t yp e a n d r ec or d l e ng t h. If t h e le re s id es
on tape, or if the records are not all the same
type and length, a warning diagnostic is issued and
the SM5FAST option is canceled. The files are then
processed using CRM. Sort/Merge obtains block and
r e c o r d t y p e i n f o r m a t i o n f r o m t h e l e i n f o r m a t i o n
table (FIT); a FILE control statement is not
ignored. Calling the SM5FAST procedure with 'YES'
results in increased speed, but not all errors are
diag n o sed; use t his p roced u r e wh e n yo u are sure
your files are correctly written and described.
SM5NODA
Execution of the SM5N0DA procedure specifies that
Sort/Merge dayfile messages are to be suppressed.
The format of the SM5N0DA call is shown in gure
5-10.
CALL SM5NODA
Figure 5-10. SM5NODA Format
The integer you specify is the exact number of
characters in each record; a catastrophic error
results if a record from an owncode routine does
n o t h a v e t h e e x a c t n u m b e r o f c h a r a c t e r s . I f t h e
SM50FL procedure is not called, records from an
owncode routine can be no longer than the longest
allowed input or output record. You cannot call
both the SM50FL procedure and the SM50MRL procedure
in the same sort or merge.
SM50MRL
Execution of the SM50MRL procedure specifies the
maximum length of any record from an owncode
routine. The format of the SM50MRL call is shown
in figure 5-12.
CALL SM50MRLIinteger)
Figure 5-12. SM50MRL Format
The integer you specify is the maximum record
length in characters. (The SM50FL procedure is
recommended if all records from an owncode routine |
are the same length.) The SM50MRL procedure need
not be called if the sort or merge has an input or
outp u t l e with a m a ximum reco r d len g th a t lea s t
a s l o n g a s t h e r e c o r d l e n g t h s p e c i e d b y t h i s
procedure. If the SM50MRL procedure is not called,
records from an owncode routine can be no longer |
than the longest allowed input or output record.
You cannot call both the SM50MRL procedure and the
S M 5 0 F L p r o c e d u r e i n t h e s a m e s o r t o r m e r g e . |
SMSOWNn
Execution of the SMSOWNn procedure specifies an
owncode routine that is executed each time a
certain point is reached during the sort or merge.
The format of the SM50WNn call is shown in figure
5-13. |
CALL SM50WNn(proc)
n1, 2, 3, 4, or 5
proc Owncode routine
beginning with a
name;
letter.
1 to 7 letters or digits.
SM50FL Figure 5-13. SM50WNn Format
Execution of the SM50FL procedure specifies the
number of characters In fixed length records from
an owncode routine. The format of the SM50FL call
is shown in figure 5-11.
CALL SM50FL(integer)
Figure 5-11. SM50FL Format
The procedure you specify is the name (address) of
the owncode routine; in a FORTRAN program, the name
must be declared in an EXTERNAL statement. The n
associated with the SM50WNn call must be 1, 2, 3,
4, or 5. If the SM50WNn procedure is not called,
no owncode routine is executed.
SM5RETA
Execution of the SM5RETA procedure can specify that
records with equal sort keys are output in the same
5-4 60484800 D
order as they are input. The format of the SM5RETA
call is shown in figure 5-14.
CALL SM5RETA(option
option 'YES' or 'Y'
' N O ' o r ' N '
| Figure 5-14. SM5RETA Format
T h e o p t i o n c a n b e ' YE S ' o r ' N O ' ( o r ' Y ' o r ' N ' ) .
If the option is 'YES', records with equal keys
retain their original order. If the option is
' N O ' , r e c o r d s w i t h e q u a l k e y s m i g h t n o t r e t a i n
their original order.
If RETAIN=YES and you specify more than one sort or
merge input file with the SM5FROM procedure, the
order in which you specify the input files is the
order in which records with equal keys are output.
If the SM5RETA procedure is not called, records
with equal keys might not be output in the same
order as they are input.
I You cannot specify both the SM5RETA procedure and
the SM5SUM procedure in the same sort or merge. If
you do specify both, a catastrophic error occurs.
SM5SEQx
Execution of a series of SM5SEQx procedures
specifies a user-defined collating sequence that is
referenced by the SM5KEY procedure. The formats of
the SM5SEQx calls are shown in figure 5-15.
CALL SM5S EQN ('name')
CALL SM5SEQS('char* 'char')
[CALL SM5SEQRCYES') or CALL SM5SEQR{'Y')
[CALL SM5SEQA('YES') or CALL SM5SEQA('Y')
'name' Collating sequence name; 1 to 31 letters,
digits, or the special characters ? # @ —.
Only 10 characters are significant and the
first must be a letter.
'char' Character in the collating sequence.
Figure 5-15. SM5SEQx Formats
The SM5SEQN procedure names your collating sequence.
The name is a literal enclosed in apostrophes; the
name cannot be the same as the name of one of the
predefined collating sequences. The SM5SEQN proce
dure must be the first called in the series of
SM5SEQx procedures.
Co l la t in g p osi ti o ns ar e a s si g ne d t o t h e c ha r ac t er s
in your collating sequence by the SM5SEQS proce
dure, which can be called more than once. Each
SM5SEQS procedure specifies a value step in the
sequence. A value step consists of one or more
characters, and characters specified in the same
step collate equally. Characters specified with
the first SM5SEQS procedure called collate first,
characters specified with the second SM5SEQS
procedure called collate second, and so on. The
following paragraphs describe how to specify steps
in your collating sequence with SM5SEQS procedures.
You can specify a value step consisting of one
character by a graphic character (see appendix A)
enclosed in apostrophes as in the following example:
CALL SM5SEQS('A')
You can specify a value step consisting of several
characters by single characters enclosed in
apostrophes and separated by commas. Tne following
example specifies a step consisting of the blank
and the digits 0, 1, 2, and 3, all of which collate
equally:
CALL SM5SEQSC ' ,'0','1','2','3')
If the SM5SEQR procedure is called, equal collating
position is assigned to any characters not
sp ecie d by SM5 SEQS procedure s. F or e xampl e, if
you define a collating sequence that includes
digits and letters but not any of the special
characters (such as commas, periods, slashes), a
call to SM5SEQR includes the special characters in
your collating sequence. The special characters
a l l c o l l a t e e q u a l l y. T h e S M 5 S E Q R p r o c e d u r e c a n
only be called once for each call to SM5SEQN; the
SM5SEQR procedure can be called anywhere in the
SM5SEQx series.
If the SM5SEQA procedure is called, characters in
the same value step are altered on output to the
first character in the step. The following example
alters all asterisks and ampersands to slashes:
CALL SM5SEQS('/','*','&')
CALL SM5SEQA('YES')
The SM5SEQA procedure can only be called once for
each call to SM5SEQN; the SM5SEQA procedure can be
called anywhere in the SM5SEQx series.
Your collating sequence specification is terminated
by any procedure call other than SM5SEQS, SM5SEQR,
or SM5SEQA. You can dene more than one collating
sequence by calling a separate series of SM5SEQx
procedure s for e ach co l l a ting s e q u ence. The name
of ea c h c ol l ati ng seq uen ce m us t b e u n iq u e. If no
SM5SEQx procedures are called, a nonstandard
collating sequence is not defined.
SM5ST
E x e c u t i o n o f t h e S M 5 S T p r o c e d u r e s p e c i e s a n
integer variable that is set to a value represent
ing the highest level of error that occurred during
the sort or merge. The format of the SM5ST call is
shown in figure 5-16. |
CALL SM5ST(variable)
variable Symbolic name of an integer variable; 1 to
7 letters or digits, beginning with a letter.
Figure 5-16. SM5ST Format
0ms,
60484800 D 5-5
The error level that is represented by the value
returned to the SM5ST procedure is shown in table
5-3. For example if a 3 is returned to the SM5ST
procedure, a fatal error occurred during the sort
or merge. If you call the SM5ST procedure, Sort/
Merge does not abort if a catastrophic error occurs
before any data records are input. However, if
Sort/Merge calls another product and an unrecover
able error results, an abnormal job termination
w i l l o c c u r . F o r e x a m p l e , i f S o r t / M e r g e c a l l s a
product, such as Common Memory Manager (CMM), and
CMM processing results in an error, a termination
wi ll o c c u r.
TABLE 5-3. ERROR LEVEL CODES, SM5ST CALL
Error Level Code
No errors
Trivial 10
Warning 20
Fatal 30
Catastrophic 40
SM5SUM
Execution of the SM5SUM procedure specifies fields
that are to be summed in records with equal key
values. Input files for a merge with summing must
be presorted and pre summed. As many as 255 bytes
can be summed. The records with all key fields
equal are combined into one new record, and the
other records with equal keys are deleted. The one
resultant record contains the key fields and the
e l d s t h a t a r e t h e s u m s o f t h e s p e c i e d e l d s
from all the records with equal keys; a data field
t h a t i s n o t a k e y e l d o r a s u m e l d i s s e t t o
the corresponding field from one of the old records.
The format of the SM5SUM call is shown in figure
5-17.
CALL SM5SUM(first,length,'type',rep)
first First byte or bit of the sum field.
length Number of bytes or bits in the sum field.
'type* Name of a numeric data format.
rep Number of fields to be summed.
Figure 5-17. SM5SUM Format
All the fields to be summed must contain numeric
data; otherwise, the contents of the new field are
undefined. The fields described as sum fields
cannot also be key fields.
The SM5SUM procedure call specifies the first byte
or bit of the sum field, the length of the sum
field in bytes or bits (length can be a maximum of
17 bytes), the type of data in the sum field (the
name of a numeric data format except REAL), and the
number of fields to be summed. See section 2 for a
list of numeric data formats.
If you specify multiple fields with one SM5SUM
proc e d ure, the e lds m ust b e c o n secut i v e, b e the
same length, and contain the same type of numeric
data. Sum fields cannot overlap one another. If a
s u m e l d c o n t a i n s n o d a t a b e c a u s e a r e c o r d i s
short, the sum for that field is undefined.
Figure 5-18 shows an example of an SM5SUM procedure I
c a l l . P a r t A o f g u r e 5 - 1 8 s h o w s t h e l a y o u t o f |
the record containing fields to be summed. Part B
shows three SM5SUM procedure calls, each describing
one field to be summed. Part C shows one equiva
lent SM5SUM procedure call that describes the three
consecutive fields to be summed.
If the summing of the specified fields results in
new numeric values that do not fit into the sum
fields, a fatal error results. One of the records
that caused the overflow is deleted as usual, but
the sum eld contents in the remaining record are
undefined. A diagnostic message indicating which
field caused the overflow is issued, and the job is
terminated at the end of the sort (unless you call
the SM5ST procedure).
You can call the SM5SUM procedure as many as 100
ti me s d u r in g a s or t o r m e r g e t o s pe ci fy d i ff e r e nt
sum fields. If the SM5SUM procedure is not called,
records with equal key values are not automatically
combined into single records. You cannot call both
the SM5SUM procedure and the SM50WN5 procedure in
the same sort or merge.
You cannot specify both the SM5RETA and the SM5SUM
procedure in the same sort or merge. If you do
specify both, a catastrophic error occurs.
A&^^S
5-6 60484800 D
A. Record Layout
10 15 20 25
Student number
(sort key)
Number of
units registered
Number of
units completed Grade points
B. SM5SUM Procedure Calls
CALL SM5SUM(11,5,'INTEGER',1)
CALL SM5SUM(16.5,'INTEGER', D
CALL SM5SUM(21,5,'INTEGER', 1)
C. SM5SUM Procedure Call
CALL SM5SUM(11,5,'INTEGER', 3)
Figure 5-18. SM5SUM Procedure Call Example
/$*S SM5END
Execution of the SM5END procedure terminates your
sort or merge specification and initiates Sort/
Merge processing. The format of the SM5END call Is
shown in figure 5-19. The SM5END procedure must be
the last called for any one sort or merge.
CALL SM5END
Figure 5-19. SM5END Format
yims.
60484800 D 5-7
COBOL INTERFACE
/ f ^ v
Two options are available for using Sort/Merge 5
from COBOL 5: a control statement option when you
use the COBOL SORT or MERGE statement and direct
calls. This section describes these two options.
COBOL5 CONTROL STATEMENT
OPTION
Sort/Merge is used by COBOL when the COBOL SORT or
MERGE statement is included in your program. You
can select Sort/Merge 5 by means of a C0B0L5
control statement option. If you specify S0RT5 in
your C0B0L5 control statement, Sort/Merge 5 is used
when the SORT or MERGE statement in your program
executes. Figure 6-1 shows a sample C0B0L5 control
statement that includes the SORTS option. See the
COBOL 5 reference manual for information on coding
the SORT or MERGE statement in a program.
COBOL5,l=PROGA,SORT5,L=REPTO.
Figure 6-1. COBOL5 Control Statement
Example
DIRECT CALLS
Direct calls from a COBOL 5 program to the Sort/
Merge procedures described in section 5 can be made
with ENTER FTN5 SM5xxx statements. Calls to the
procedures cannot be mixed with the SORT or MERGE
s t a t e m e n t ; t h e p r o c e d u r e s c a n n o t b e c a l l e d i n a
COBOL input or output procedure, and the SORT or
MERGE statement cannot be executed in a series of
direct calls (before SM5END is called). See the
COBOL 5 reference manual for information on coding
ENTER statements.
All files to be sorted or merged must be sequential
files. The default file characteristics are block
type C, record type Z, and full length of 150
characters or less. For files with other block
types and record types, you must include CYBER
Record Manager (CRM) FILE control statements in the
control statement section of your job (see the CRM
Basic Access Methods reference manual).
r
r60484800 A 6-1
0ms OWNCODE ROUTINES
Yo u c a n w r i t e a r o u t i n e t o i n s e r t , s u b s t i t u t e ,
modify, or delete input and output records during
Sort/Merge processing. Your routine, called an
owncode routine, is executed each time the sort or
merge reaches a certain point. Sort/Merge passes a
record to the owncode routine, which processes the
record. When the record is returned to Sort/Merge
from the owncode routine, Sort/Merge processes the
record according to an option specified by the
owncode routine. Owncode routines can also supply
the records to be sorted; when Sort/Merge is ready
for a record, the owncode routine passes a record
to Sort/Merge.
point in processing at which your owncode routine
is executed. Figure 7-1 shows the format for
naming an owncode routine in a control statement
and in a procedure call, and the subrou tine state
ment format, which is a standard FORTRAN subroutine
statement.
OWNn=proc CALL SM50WNn(proc)
SUBROUTINE proc(retum_code,reca,rla[,recb,rlb])
Owncode routines are routines written in FORTRAN
(subroutine subprograms) or some other language
that have been compiled and saved in relocatable
binary form. The file containing your owncode
routines is automatically loaded during Sort/Merge
processing. This section describes specifying
owncode routines and the available processing
options.
SPECIFYING OWNCODE ROUTINES
To specify owncode routines when you are using
control statement calls to Sort/Merge, you use the
OWNF parameter. The OWNF parameter gives Sort/
Merge the name of the file containing your owncode
routines; the file is loaded by Sort/Merge by means
of the user call loader so that the routines are
av ailable during Sort/Merge processing. The names
of your owncode routines are specified with the
OWNn parameter; n is an integer from 1 through 5
that tells Sort/Merge at which point in processing
the routine is executed. You must supply a sepa
rate subroutine for each OWNn specified.
When you are using procedure calls to Sort/Merge,
you call SM50WNn to specify the name of an owncode
routine and to indicate at which point in process
ing the routine is executed. Owncode routines must
be loaded along with the Sort/Merge procedures.
You cannot use AAM to process files within an
owncode routine when executing a control card
Sort/Merge. In a FORTRAN program, you must name
the owncode routines in an EXTERNAL statement. You
cannot call SMSOWNn from a COBOL program because
there is no way (other than CALL or ENTER) to tell
COBOL the name of an external subroutine. You can
write a subroutine in FORTRAN or some other
language to call the owncode routine.
Ownc o d e exits 1 a n d 2 can be taken from a sort
only; exits 3, 4, and 5 can be taken from a sort or
merge.
OWNCODE ROUTINE PARAMETERS
Owncode routines are called with parameters. Up to
ve parameters are passed between Sort/Merge and
your owncode routine. Parameters are passed at the
Figure 7-1. Owncode Routine Call and Subroutine
Statement Formats
If you specify an owncode 1, owncode 2, owncode 3,
or ow n co d e 4 r o ut i ne , t he ret ur n _c o de , r e ca , a n d
rla parameters are passed by Sort/Merge. If you
specify an owncode 5 routine, the recb and rib
parameters are passed in addition to the other
three parameters. The parameters are described in
the following paragraphs.
The return_code parameter is passed by Sort/Merge
to an owncode routine as an integer with value 0.
The return_code parameter can be altered by the
owncode routine to the integer value 1, 2, or 3.
The value returned to Sort/Merge by this parameter
indicates a specific action to be taken by Sort/
Merge. A return_code value that is not defined
ca u se s a cat ast r op h ic er r or. T h e m ea n in g s o f t he
various return_codes are discussed later in this
section.
The reca parameter is an otherwise empty array or
string variable that is used to pass the current
record; except f o r the c u r r e n t record, the conte n t s
of reca are undefined. The rla parameter passes a
value that is the number of characters in the
current record being sorted or merged.
The recb and rib parameters are used when proc
essing two records with equal keys. The recb
parameter passes the second record; the rib
p a r a m e t e r p a s s e s a v a l u e t h a t i s t h e n u m b e r o f
characters in the second record.
The allowed length of records passed to an owncode
routine depends on how you have specified record
length. If you have specified the OWNFL parameter
or have called the SM50FL procedure, the number of
characters in the current record must be the same
a s t h e O W N F L o r S M 5 0 F L v a l u e . O t h e r w i s e , t h e
maximum record length is determined as the largest
MRL or FL FIT field in a CYBER Record Manager FILE
control statement, or the largest value from the
OWNMRL parameter or the SM50MRL procedure; all
records must contain between one and this maximum
record length number of characters, inclusive. An
rla or rib parameter value that does not correspond
to a record specification causes a catastrophic
error.
60484800 D 7-1
The reca, rla, recb, and rib parameters can be
altered by an owncode routine; the routine can pass
a different record back to Sort /Merge in reca or
recb, and t h e num b e r of characte r s in the r e c o rd
can b e d i ffe r e nt. The parame t e rs m u s t be passe d
from an owncode routine in order: return_code,
reca, rla, recb, and rib. The arrays reca and recb
can be any type of array.
p r o c e s s i n g o f t h e r e c o r d , c o n t r o l r e t u r n s t o
Sort/Merge, which processes the record passed back
in reca according to the return_code value set by
the owncode 1 routine (the record passed back to
Sort/Merge in reca can be different from the record
passed to the routine). The return_code value and
the associated processing performed by Sort/Merge
can be as follows:
Table 7-1 summarizes the owncode routines and the
parameters passed. Figure 7-2 illustrates record
movement from Sort/Merge to an owncode routine and
back to Sort/Merge.
OWNCODE 1: PROCESSING
INPUT RECORDS
The 0WN1 parameter or the SM50WN1 procedure call
names an owncode 1 routine that is executed in one
of two instances.
I f y o u h a v e s p e c i e d i n p u t l e s w i t h t h e F R O M
parameter or the SM5FR0M procedure call, the
owncode 1 routine is executed after reading each
record. The return_code, reca, and rla parameters
are passed to the routine by Sort/Merge. The
return_code is 0, reca contains the record, and rla
is the record length in characters. After owncode
0 The record passed back to Sort/Merge in
reca is sorted.
1 The record passed back to Sort/Merge in
reca is deleted.
2 A n a d d i t i o n a l r e c o r d i s i n s e r t e d i n t o t h e
sort. The record in reca is entered into
the sort, and the owncode 1 routine is
executed again with reca and rla set to the
record that just entered the sort.
3 Input from the current file is terminated.
The record in reca and remaining records in
the file are not sorted. If more input
files are specified, records are read from
the next input file. The owncode 1 routine
is executed after reading e a ch rec o r d from
this next file.
TABLE 7-1. OWNCODE ROUTINE SUMMARY
Routine
Type Processing
Parameters Passed
Return__code Value
Returnjcode reca rla recb rib
Owncode 1 Input records 0 Sort current record.
1 Delete current record.
2 Insert new record.
3 Terminate input from
current file.
Owncode 2 Input files 0 Begin processing next
i n p u t l e .
1 Insert new record.
Owncode 3 Output records 0 M o d i f y c u r r e n t r e c o r d .
1 D e l e t e c u r r e n t r e c o r d .
2 Create new record.
3 Terminate output.
Owncode 4 Output files 0 Sort or merge is complete.
1 Insert new record.
Owncode 5 Equal keys 0 Retain both records.
1 Replace both records with
new record.
7-2 60484800 A
Record
y^s
Sort/Merge Owncode
Routine
V
"s^
Record "*"~~
Figure 7-2. Owncode Routine Record Flow
If you have not specified any input files, the
owncode 1 routine is executed when Sort/Merge
is ready for another record to process. The
return_code, reca, and rla parameters are passed to
the routine by Sort/Merge. The return_code is 0,
reca is an empty array with room for the largest
record, and rla is 0. When control is returned
t o S o r t / M e r g e f r o m t h e o w n c o d e 1 r o u t i n e , t h e
return_code value and the associated processing
performed by Sort/Merge can be as follows:
0 The record passed back to Sort/Merge in
reca is sorted.
2 A n a d d i t i o n a l r e c o r d i s i n s e r t e d i n t o t h e
sort. The record in reca is entered into
t h e s o r t , a n d t h e o w n c o d e 1 r o u t i n e i s
executed again with reca and rla set to the
record that just entered the sort.
3 Input is terminated.
OWNCODE 2: PROCESSING
INPUT FILES
The 0WN2 parameter or the SM50WN2 procedure call
names an owncode 2 routine that is executed in one
of two instances.
If you have specified input files with the FROM
p a r a m e t e r o r t h e S M 5 F R 0 M p r o c e d u r e c a l l , t h e
owncode 2 routine is executed after input from a
file has terminated (input terminates when end-
of-section is found on file INPUT, when end-of-file
is found on any other file, or when an owncode 1
ro ut i n e p a ss es a r e t ur n_ c o d e v a l ue o f 3 to So rt /
Merge). The return_code, reca, and rla parameters
a r e p a s s e d t o t h e r o u t i n e b y S o r t / M e r g e . T h e
return__code is 0, and reca and rla are passed as a
null record; reca is an empty array, and record
length is 0. When control is returned to Sort/
Merge from the owncode 2 routine, the return_code
value and the associated processing performed by
Sort/Merge can be as follows:
0 Processing of the next input file, if any,
begins.
1 A n a d d i t i o n a l r e c o r d i s i n s e r t e d i n t o t h e
sort after the last record. The record
i n s e r t e d i s t h e fi r s t r l a c h a r a c t e r s i n
reca, which have been provided by the
routine. The owncode 2 routine is executed
again.
If you have not specified any input files, the
owncode 2 routine is executed after an owncode 1
routine has terminated input. The return_code,
reca, and rla parameters are passed to the routine
by Sort/Merge. The return_code is 0, and reca and
rla are passed as a null record. When control is
returned to Sort/Merge from the owncode 2 routine,
the return_code value and the associated processing
performed by Sort/Merge can be as follows:
0 Signals the end of input.
1 A n a d d i t i o n a l r e c o r d i s i n s e r t e d i n t o t h e
sort after the last record. The record
i n s e r t e d i s t h e fi r s t r l a c h a r a c t e r s i n
reca, which have been provided by the
routine. The owncode 2 routine is executed
again.
OWNCODE 3: PROCESSING
OUTPUT RECORDS
The 0WN3 parameter or the SM50WN3 procedure call
names an owncode 3 routine that is executed in one
of two instances.
I f y o u h a v e s p e c i e d a n o u t p u t l e w i t h t h e T O
parameter or the SM5T0 procedure call, the own-
code 3 routine is executed before writing a record
to the output file. The return_code, reca, and rla
parameters are passed to the routine by Sort/
Merge. The return_code is 0, reca is the record,
and rla is the record length in characters. After
owncode processing of the record, control returns
to Sort/Merge, which processes the record passed
back in reca according to the return_code value set
by the owncode 3 routine. The return_code value
and the associated processing performed by Sort/
Merge can be as follows:
0 The record passed back to Sort/Merge in
reca is written to the output file.
1 The record passed back to Sort/Merge in
reca is deleted.
2 An additional record is written to the
output file. The record in reca is written
out, and the owncode 3 routine is executed
again with reca and rla set to the original
record.
3 O u t p u t f r o m t h e c u r r e n t fi l e i s t e r m i
nated. The record in reca is not written
ou t . I f a n o wnc ode 4 r ou t in e i s s p ec i e d ,
i t i s e x e c u t e d ; o t h e r w i s e , t h e s o r t o r
merge is terminated.
60484800 C 7-3
If you have not specified an output file, the
owncode 3 routine is executed when a record is
ready for output; sorted or merged records are
processed by the routine. The return_code, reca,
and rla parameters are passed to the routine by
S o r t / M e r g e . T h e r e t u r n _ c o d e i s 0 , r e c a i s t h e
record, and rla is the record length in char
acters. When control is returned to Sort/Merge
from the owncode 3 routine, the return_code value
and th e associated p r o c e s s i n g performed by Sort/
Merge can be as follows:
1 T h e r e c o r d p a s s e d b a c k t o S o r t / M e r g e i n
reca is deleted.
3 Output is terminated. If an owncode 4
routine is specified, it is executed;
otherwise, the sort or merge is terminated.
OWNCODE 4: PROCESSING
OUTPUT FILES
The OWN4 parameter or the SM50WN4 procedure call
names an owncode 4 routine that is executed in one
of two instances.
If you have specified an output file with the TO
parameter or the SMSTO procedure call, the owncode
4 r o u t i n e i s e x e c u t e d a f t e r t h e l a s t r e c o r d h a s
been written to the output file. The return_code,
reca, and rla parameters are passed to the routine
by Sort/Merge. The return_code is 0, and reca and
rla are passed as a null record. When control is
returned to Sort/Merge from the owncode 4 routine,
the return_code value and the associated processing
performed by Sort/Merge can be as follows:
0 The sort or merge is completed.
0 The sort or merge is completed.
1 This value is not allowed since no output
file has been specified.
OWNCODE 5: PROCESSING
RECORDS WITH EQUAL KEYS
The 0WN5 parameter or the SM50WN5 procedure call
names an owncode 5 routine that is executed when
two records with equal key values are encountered
during a sort or merge (when you have defined your
own collating sequence, key values can be equal
even if key characters are not identical). The key
e l d s m u s t n o t b e m o d i e d o r e l s e t h e s o r t i n g
order is undefined. The return__code, reca, rla,
recb, and rib parameters are passed to the routine
by Sort/Merge. The return_code is 0; reca and recb
contain the first and second records, respectively,
and rla and rib contain the record lengths in
characters of the first and second records,
respectively. After owncode 5 routine processing
of the two records, control is returned to
Sort/Merge, which processes the records according
to the return_code value set by the owncode 5
routine. The return_code value and the associated
processing performed by Sort/ Merge can be as
follows:
0 The first rla characters of reca are
a c c e p t e d a s t h e r s t r e c o r d ; t h e r s t r i b
characters of recb are accepted as the
second record (the records and record
lengths passed back to Sort/Merge can be
different from the records and record
lengths passed to the owncode routine).
X^iffijJV
An additional record is inserted after the
l a s t r e c o r d . T h e r e c o r d i n s e r t e d i s t h e
first rla characters in reca. The owncode
4 routine is executed again.
One duplicate record is deleted. The other
record is replaced with the first rla char
acters of reca.
If you have not specified an output file, an
owncode 4 routine is executed after the last call
t o a n o w nc o d e 3 r o ut i n e i n d i c at i n g t h a t t h e s o r t
has been completed. If output is terminated by an
owncode 3 routine, an owncode 4 routine is called
immediately. The return_code, reca, and rla
parameters are passed to the routine by Sort/Merge.
The return_code is 0, and reca and rla are passed
as a null record. When control is returned to
Sort/Merge from the owncode 4 routine, the
return_code value and the associated processing
performed by Sort/Merge can be as follows:
If you specify RETAIN=YES or call the SM5RETA
procedure in a sort with an owncode 5 routine, the
record that entered the sort first is passed to the
owncode routine as reca; otherwise, either of the
two records with equal keys could be passed to the
routine as reca. The owncode 5 routine can control
the order in which the two records are returned to
Sort/Merge. The record returned to Sort/Merge as
reca is entered into the sort before the record
returned as recb. An owncode 5 routine cannot be
specied in the same sort as a SUM parameter or
SM5SUM procedure.
7-4 60484800 D
EXAMPLES
T h i s s e c t i o n c o n t a i n s e x a m p l e s o f s o r t s a n d
merges. The first example is a simple control
statement sort on one key. The same sort is illus
t r a t e d u s i n g t h e i n t e r a c t i v e d i a l o g . A c o n t r o l
st a t e m e n t so rt o n m u l t i p l e ke y s , a c o n t r o l s ta te
me n t m er ge , d i r e ct iv e l e c re a t i o n an d u s e , S U M
parameter use, and a FORTRAN program with Sort/
Merge procedure calls and an owncode routine are
also included.
CONTROL STATEMENT SORT ON
ONE KEY
Figure 8-1 shows the record layout in a university
student file named UNIVER. Each record includes
the last name and first and middle initials, the
s t u d e n t n u m b e r, t h e d a t e o f b i r t h , t h e e l d o f
study, the grade point average, and a code repre
senting class (freshman, sophomore, junior,
s e n i o r ) ; a l l e l d s a r e w r i t t e n w i t h c h a r a c t e r
data. The file is maintained with the student
number as the major key. Records are normally
ordered in ascending order according to the student
number as shown in figure 8-2 with file UNIVER.
Figure 8-3 shows the job structures for sorting
file UNIVER to give an alphabetic list of
students. Under both NOS and NOS/BE operating
systems, the job statements and accounting infor
mation are followed by ATTACH commands to assign
the file to the job. CYBER Record Manager (CRM)
FILE control statements are included, because the
input and output records contain only 38 characters
each, considerably less than the default of 150.
The S0RT5 control statement calls for records from
UNIVER to be sorted on a key that occupies charac
ter positions 1 through 10 in each record according
to the default ASCII6 collating sequence in ascend
i n g o r d e r . S o r t e d r e c o r d s a r e w r i t t e n t o l e
SRTOUT, which is created as a local file during the
sort. File SRTOUT is then copied to file OUTPUT
with a right shift, because the first character in
the print line is reserved for carriage control.
Figure 8-4 shows the output from the job.
WALLACE 87366110255ENGIR 2861
JOHNSON 90248063051HATH 2253
SANDERS 99855022858BUS 3011
NEECE 99911121358ART 2291
TERRELL 99998040356ENG 3861
OKADA 100103111750UNDEC 2225
REYES 100246031558ANTHR0 3341
SUGARMAN 100528070457S0C 3501
PHILLIPS 100531121158EDU 2112
KRUTZ
100532010353P0LISCI 1981
WARNES 102116060861P0LISCI 2814
CARLSON 102126022355ENGIR 3454
FUHRMAN 102212111859CHEM 3204
MCMAHON 102223061260ENG 2784
JUNG 102301052561PHYSED 2214
P0P0VICH 102311100961BUS 2434
JONES 102318081555EDU 2844
PEAKE 102326111960J0URN 3024
BRISCOE 102343121157ENVIR0 2544
HORNE 102377070861COMPSCI 3894
Figure 8-2. File UNIVER
SORT SPECIFICATION USING
INTERACTIVE DIALOG
Figure 8-5 shows the interactive dialog used to
specify the same sort of file UNIVER on the last
name. The input file is assigned to the job with
an ATTACH command under NOS or a FETCH command
under NOS/BE. CRM FILE control statements are
en t er e d f or the in put an d o u tp u t le s . Th e d i al o g
is invoked by typing DIAL0G=»YES. Sorted records
are written to file SORTOUT, which Sort/Merge
creates as a local file. File SORTOUT can be
printed or displayed at the terminal; SORTOUT can
also be routed to a printer or saved as a permanent
file.
1 1 1 1 3 1 5 2 1 2 7 3 5 3 8
LAST NAME STUDENT
NO. DOB STUDY GPA
FIRST INITIAL MIDDLE INITIAL CQDE
Figure 8-1. File UNIVER Record Layout
60484800 B 8-1
NOS Operating System
Job statement
USER statement
CHARGE statement
ATTACH,UNIVER.
FILE(UNIVER,BT=C,RT=Z,FL=38)
FILE(SRTOUT,BT=C,RT=Z,FL=38)
SORT5.FROM=UNIVER,TO=SRTOUT,KEY=1. .10
COPYSBF,SRTOUT,OUTPUT.
EOI
NOS/BE Operating System
Job statement
ACCOUNT statement
ATTACH,UNIVER,ID=PUBS.
FILE(UNIVER,BT=C,RT=Z,FL=38)
FILE(SRTOUT,BT=C,RT=Z,FL=38)
SORT5.FROM=UNIVER,TO=SRTOUT,KEY=1. .10
COPYSBF,SRTOUT,OUTPUT.
EOI
Figure 8-3. Job Structure for Sorting File
UNIVER on Last Name
BARTLETT 100800100957ART 2735
BILLINGS 101579111855MUS 2965
BRISCOE 102343121157ENVIR0 2544
CARLSON 102126022355ENGIR 3454
CHARLES 101418032459ANTHRO 2453
CLARK 101400102954EC0N 3782
CLARK 101023101956ENG 2083
COCHRAN 100725111857BI0 3011
DAVIES 100812080656JOURN 2031
DAVIS
100972071650ENG 3541
WALLIN 101056041659P0LISCI 3151
WARNES 102116060861P0LISCI 2814
WILSON 101967010261MATH 3454
WONG 101001012755PSYCH 2152
WOO 101315100159BUS 3223
WOODSTOCK 101497030160CHEM 3483
YEH 102005120645ART 2764
YOST 100880111158ENG 2582
ZEITZ 100963111858MATH 2612
ZIMMERS 101075063059MATH 2992
/"^S
Figure 8-4. File UNIVER Sorted on Last Name
/attach,univer
tiile(univer,bt=c,rt=z,f1=38)
FILE<UNIVER,BT=C,RT=Z,FL=38)
/file(sortout,bt=c,rt=z,f1=38)
FILE(SORTOUT,BT=C,RT=Z,FL=38)
/sort5.dialog=yes
IS YOUR TERMINAL ALREADY SET TO NORMAL MODE OR UPPERCASE
ASCII MODE. ALSO, ARE YOU SURE THAT ALL YOUR FILES (IF ANY)
ARE EITHER STANDARD UNIT RECORD FORMAT OR HAVE HAD FILE
CONTROL STATEMENTS SPECIFIED FOR THEM
? yes
DO YOU HAVE JUST ONE INPUT FILE AND NO 0WN1 OR 0WN2 SUBROUTINES
? yes
WHAT IS THE NAME OF YOUR INPUT FILE
? univer
DO YOU HAVE ANY 0UN3 OR 0WN4 SUBROUTINES
? no
WHAT IS THE NAME OF YOUR OUTPUT FILE
? sortout
THE STANDARD COLLATING SEQUENCE IS ASCII6.
HERE IS THE WHOLE ASCII6 COLLATING SEQUENCE LISTED
!,,#$%&,()*+,-./0123456789:;<=>?aABCDEFGHIJKLMNOPQRSTUVWXYZC\3',
DO ALL OF YOUR KEYS CONSIST OF CHARACTER DATA TO BE SORTED
ACCORDING TO THE ASCII6 COLLATING SEQUENCE
? yes
ASCENDING ORDER OF THE ASCII6 COLLATING SEQUENCE MEANS THE
NORMAL ORDER.
!«•#$%&•()*+,-./0123456789:;<=>?aABCDEFGHIJKLMNOPQRSTUVWXYZC\D*
DESCENDING ORDER MEANS THE REVERSE ORDER.
_*3\CZYXWVUTSRQP0NMLKJIHGFEDCBA3?>=<;:9876543210/.-,+*)C8%$#"!
DO YOU WANT ALL YOUR KEYS SORTED IN ASCENDING ORDER
? yes
HOW MANY KEY FIELDS DO YOU HAVE
? 1
THE LEFT-MOST CHARACTER OF A RECORD IS NUMBER 1.
FOR THE MOST IMPORTANT KEY FIELD, WHAT IS THE NUMBER
OF THE LEFT MOST CHARACTER
? 1
HOW MANY CHARACTERS ARE IN THE MOST IMPORTANT KEY FIELD
? 10
DO YOU WANT RECORDS WITH EQUIVALENT KEY VALUES TO BE WRITTEN
IN THE SAME ORDER THEY ARE READ
? no
GIVE AN ESTIMATE OF THE MAXIMUM NUMBER OF RECORDS TO BE SORTED
? 75
THANK YOU. SORT/MERGE NOW BEGINS.
S0RT5.DIAL0G=YES
/
/*s%
s*^S
8-2 Figure 8-5. Interactive Dialog Example 60484800 D
CONTROL STATEMENT SORT ON
MULTIPLE KEYS
Figure 8-6 shows the job structures for sorting
file UNIVER on three keys. Under both NOS and
NOS/BE, the job statements and accounting informa
tion are followed by ATTACH commands to assign the
file to the job. CRM FILE control statements for
the input and output files are included. The S0RT5
control statement calls for records to be first
sorted on the field of study, which occupies char
acter positions 27 through 34 in each record.
Records with equal keys for the major key are then
sorted on the class code, which is a 1-character
field in position 38. The third key sorts students
with the same field of study and class by the last
name.
Aj^^S
NOS Operating System
Job statement
USER statement
CHARGE statement
ATTACH,UNIVER.
Fl LE(UNIVER,BT=C,RT=Z,FL=38)
FILE(SRTOUT,BT=C,RT=Z,FL=38)
SORT5.FROM=UNIVER,TO=SRTOUT,
.KEY=((27. .34),(38,1),(1. .10))
COPYSBF,SRTOUT,OUTPUT.
EOI
NOS/BE Operating System
Job statement
ACCOUNT statement
ATTACH,UNIVER,ID=PUBS.
Fl LE(UNI VER,BT=C,RT=Z,FL=38)
FILE(SRTOUT,BT=C,RT=Z,FL=38)
SORT5.FROM=UNIVER,TO=SRTOUT,
.KEY=((27. .34),(38,1),(1. .10))
COPYSBF,SRTOUT,OUTPUT.
EOI
0jm*B\,
Figure 8-6. Job Structure for Control Statement
Sort on Multiple Keys
Figure 8-6 i l l ustrates c o n t i nuing the S0RT 5 control
statement beyond one line. The first line of the
control statement is terminated with three periods;
the second line begins with one period. Sorted
r e c o r d s a r e w r i t t e n t o t h e l e S R TO U T, w h i c h i s
then copied to file OUTPUT with a right shift,
because the first character in the print line is
reserved for carriage control. Figure 8-7 shows
the output from the job.
CONTROL STATEMENT MERGE
Figure 8-8 shows two files (UNIVER, ADDSTU) ordered
according to the student number. The two files can
be merged because they are sorted on the same key.
Fig u r e 8 - 9 s h ows the j ob s truc t ures to m erge the
two files. Under both NOS and NOS/BE, the two
l e s a r e at t ac h e d . A n e w l e (N E W U ) i s c r e a t e d
as a permanent file to which merged records are
written; under NOS, the DEFINE command creates an
empty direct access permanent file. Under NOS/BE,
the REQUEST command assigns NEWU to a permanent
file device; the CATALOG command then makes the
file permanent. CRM FILE control statements for
the input files and the merged file are included.
REYES 100246031558ANTHRO 3341
MAYER 100991122359ANTHR0 2882
CHARLES 101418032459ANTHRO 2453
MARTIN 100955082157ART 2891
NEECE 99911121358ART 2291
NAKAMURA 101529051260ART 2594
YEH 102005120645ART 2764
BARTLETT 100800100957ART 2735
COCHRAN 100725111857BI0 3011
H0Y0
101925103060BI0 3014
KRUTZ 100532010353P0LISCI 1981
WALLIN 101056041659P0LISCI 3151
WARNES 102116060861P0LISCI 2814
WONG 101001012755PSYCH 2152
LANGDON 101754080549PSYCH 2013
LASEUR 100678042256PSYCH 2233
SUGARMAN 100528070457S0C 3501
SMITH 101062120758SOC 2913
DOUGLAS 101325071558UNDEC 2585
OKADA 100103111750UNDEC 2225
Figure 8-7. File UNIVER Sorted on Multiple Keys
A. File UNIVER
WALLACE 87366110255ENGIR 2861
JOHNSON 90248063051MATH 2253
SANDERS 99855022858BUS 3011
NEECE 99911121358ART 2291
TERRELL 99998040356ENG 3861
OKADA 100103111750UNDEC 2225
REYES 100246031558ANTHR0 3341
SUGARMAN 100528070457SOC 3501
PHILLIPS 100531121158EDU 2112
KRUTZ
100532010353P0LISCI 1981
WARNES 102116060861P0LISCI 2814
CARLSON 102126022355ENGIR 3454
FUHRMAN 102212111859CHEM 3204
MCMAHON 102223061260ENG 2784
JUNG 102301052561PHYSED 2214
P0P0VICH 102311100961BUS 2434
JONES 102318081555EDU 2844
PEAKE 102326111960J0URN 3024
BRISCOE 102343121157ENVIR0 2544
H0RNE 102377070861COMPSCI 3894
B. File ADDSTU
QUINTERA 90154101253BI0 3451
KING 100012090848BUS 2431
ANDRUS 100478042855J0URN 2121
UNGERMAN 100933120356PHYSED 3012
KLEIN 100987051260ENGIR 2762
GIBSON 101728070160MATH 2012
IRVING 101750111855ENG 3943
ALLEN 102056012561LNGUIS 3854
GREENWOOD 102168101961EDU 2264
ANDERSEN 102308032160P0LISCI 2544
EBERHARD 102320061158BUS 3014
GOMEZ 102379Q22260COMPSCI 2984
Figure 8-8. Input Files for Control Statement Merge
60484800 B 8-3
NOS Operating System
Job statement
USER statement
CHARGE statement
ATTACH,UNIVER,ADDSTU.
DEFINE,NEWU.
Fl LE(UNI VER,BT=C,RT=Z,FL=38)
FILE(ADDSTU,BT=C,RT=Z,FL=38)
FILE(NEWU,BT=C,RT=Z,FL=38)
MERGE.FROM=(UNIVER,ADDSTU),TO=NEWU,KEY=15. .20
COPYSBF,NEWU,OUTPUT.
EOI
NOS/BE Operating System
Job statement
ACCOUNT statement
ATTACH,UNIVER,ID=PUBS.
ATTACH,ADDSTU,ID=PUBS.
REQUEST,NEWU,*PF.
FILE(UNIVER,BT=C,RT=Z,FL=38)
Fl LE(ADDSTU,BT=C,RT=Z,FL=38)
FILE(NEWU,BT=C,RT=Z,FL=38)
MERGE.FROM=(UNIVER,ADDSTU),TO=NEWU,KEY=15. .20
CATALOG,NEWU,ID=PUBS,XR=CHNG.
COPYSBF,NEWU,OUTPUT.
EOI
Figure 8-9. Job Structure for Control Statement Merge
The MERGE control statement names the two input
files and the new output file. The key on which
the files are merged is the student number (the
field on which the files are presorted). The
merged le is copied to file OUTPUT with a right
shift, because the first character In the print
line is reserved for carriage control. Figure 8-10
shows the output from the job.
WALLACE 87366110255ENGIR 2861
QUINTERA 90154101253BI0 3451
JOHNSON 90248063051MATH 2253
SANDERS 99855022858BUS 3 0 11
NEECE 99911121358ART 2291
TERRELL 99998040356ENG 3861
KING 100012090848BUS 2431
OKADA 100103111750UNDEC 2225
REYES 100246031558ANTHR0 3341
ANDRUS
100478042855J0URN 2121
MCMAHON 102223061260ENG 2784
JUNG 102301052561PHYSED 2214
ANDERSEN 102308032160P0LISCI 2544
P0P0VICH 102311100961BUS 2434
JONES 102318081555EDU 2844
EBERHARD 1023200611589US 3014
PEAKE 102326111960J0URN 3024
BRISCOE 102343121157ENVIR0 2544
HORNE 102377070861COMPSCI 3894
GOMEZ 102379022260C0MPSCI 2984
Figure 8-10. Merged File NEWU
CREATING AND USING A
DIRECTIVE FILE
Figure 8-11 shows a portion of a terminal session
in which a directive file is created. In the first
p a r t o f g u r e 8 - 11 , t h e d i r e c t i v e l e i s c r e a t e d
using XEDIT under NOS; (cr) denotes carriage
return. In the second part of the figure, the
directive file is created using EDITOR under NOS/BE.
Under NOS, XEDIT is entered after login, and the
directive file to be created is given the name
DIRFIL. The directive file statements begin with
the word SORT followed by a comma. The statements
specify a user-defined collating sequence named
MYSEQ. The first SEQS parameter specifies ten
steps from 0 to 9; the other SEQS parameter speci
fies one step consisting of hyphens, blanks, and
slashes. The SEQA parameter specifies that blanks
and slashes are to be output as hyphens. The
directive file is then reviewed (still using XEDIT)
to make s ure the le is acc u r a te. The l e DIRFIL
is saved as an indirect access permanent file.
Under NOS/BE, EDITOR is entered after login. The
statements of the directive file are identical to
the statements entered under NOS, and the directive
l e i s t h e n r e v i e w e d u s i n g t h e L I S T c o m m a n d .
Using the SAVE command, DIRFIL Is made a local file
without sequence numbers; the CATALOG command saves
the le as a permanent le.
Figure 8-12 shows a portion of a NOS terminal ses
sion in which a file named NUMFIL (figure 8-13) is
sorted according to the MYSEQ collating sequence.
The directive file and the input file are assigned
to the job with GET commands for indirect access
permanent files. CRM FILE control statements are
entered for the input and output files.
The S0RT5 control statement is then entered naming
the input and output files, the key field, and the
d i r e c t i v e fi l e ; t h e n a m e o f t h e u s e r - d e n e d
collating sequence is the key type. After Sort/
Merge reads the directive file, an image of this
file is printed or displayed at the terminal (the L
parameter default is OUTPUT). When the sort is
complete, the S0RT5 control statement is printed or
displayed at the terminal (note that NOS repeats
only 48 characters of the control statement).
Control is then returned to the operating system.
Figure 8-14 shows the output from the job using the
directive file with the MYSEQ collating sequence.
The records are in numeric order, and the separa
tors in the number have been standardized as
hyphens in all records
SUM PARAMETER USE
Figure 8-15 shows the record layout in a file named
GRADES. Each record includes three numeric fields:
number of units attempted, number of units com
p l e t e d , a n d g r a d e p o i n t s . F i g u r e 8 - 1 6 s h o w s l e
GRADES with multiple records for each student.
Records are to be sorted according to student
number and, using the SUM parameter, records with
the same student number are to be combined into one
record by adding together the numeric fields to
give the total number of units attempted, units
completed, and the total number of grade points. ^%
8-4 60484800 B
0^s
NOS Operating System
/xedi t,di rf i L,c -*-
XEDIT 3.1.00
to
INPUT -*-
sort,seqn=myseq
sort,seqs=('0'..
sort,seqs=('-','
sort,seqa=yes
9')
/')!
?
EDIT -.
?? top -m
?? print*-*
SORT,SEQN=MYSEQ
S0RT,SEQS=(,0,..'9')
S0RT,SEQS=(,-,,, ','/
S0RT,SEQA=YES
END OF FILE
?? end,dirfiL,replace
DIRFIL REPLACED
NOS/BE Operating System
COMMAND- editor
..1=sort,seqn=myseq
2=sort,seqs=('0'..'9')
3=sort,seqs=(,-,,, ,'/')
4=sort,seqa=yes
l i s t , a , s u p «
SORT,SEQN=MYSEQ
S0RT,SEQS=(,0'..,9') I
S0RT,SEQS=(,-,,, ,,*/,)l
SORT,SEQA=YES
.. save,di rf i I ,n
..end -«
COMMAND- catalog,dirfil,id=pubs
Enter XEDIT in create mode; DIRFIL is the name
given the file to be created.
Enter XEDIT input mode.
Directive file statements.
Enter XEDIT edit mode.
Move pointer to the beginning of the file.
Print the entire file.
Directive file statements.
Leave XEDIT and save DIRFIL as an indirect access
permanent file.
Enter EDITOR.
Directive file statements.
List the entire file.
Directive file statements.
Make edit file a local file without sequence numbers.
Leave EDITOR.
Save file as a permanent file named DIRFIL.
Figure 8-11. Creating a Directive File
/ g e t , d i r I
/get,numfiI
/file(numfil,bt=c,rt=z,f1=35)
FILE(NUMFIL,BT=C,RT=Z,FL=35)
/file(seqfi l,bt = c,rt = z,f1=35)
FILE(SEQFIL,BT=C,RT=Z,FL=35)
/sort5.from=numfil,to=seqfil,key=((25,11,myseq)),dir=dirfil
1
SORT/MERGE 5.0 * LISTING OF DIRECTIVE FILE - DIRFIL
12/04. 16.45.45.
1. SORT,SEQN=MYSEQ
2. S0RT,SEQS=('0,..,9')
3. S0RT,SEQS=(,-,,, •,'/)
4. SORT,SEQA=YES
SORT/MERGE 5 - 18 RECORDS SORTED
/
Figure 8-12. Using a Directive File (NOS)
60484800 B 8-5
DOE CHERYL 706-87-5430
THOMPSON LOUISE 819 95 6445
GORDON ROBERT 176/81/0013
WATSON JOSEPH 091-15-1938
ANDERSON PETER 778 21 2847
HALL MARY 029-55-1789
SMITH JOHN 555-70-6351
NORTH PATRICIA 234-58-3190
ROLLINS SARAH 770-25-8147
SHARP DANIEL 447/46/0043
LYNCH DENNIS 549-22-6741
SMITH CATHERINE 387 14 9998
NOE JANE 880-25-3058
BROWN WILLIAM 120 59 4049
HARRIS JEAN 229-80-7776
JONES CHRISTOPHER 667 /26/2514
CARTER BARBARA 114 48 5112
HENDERS GERALD 998-72-6203
Figure 8-13. File NUMFIL
HALL MARY 029-55-1789
WATSON JOSEPH 091-15-1938
CARTER BARBARA 114-48-5112
BROWN WILLIAM 120-59-4049
GORDON ROBERT 176-81-0013
HARRIS JEAN 229-80-7776
NORTH PATRICIA 234-58-3190
SMITH CATHERINE 387-14-9998
SHARP DANIEL 447-46-0043
LYNCH DENNIS 549-22-6741
SMITH JOHN 555-70-6351
JONES CHRISTOPHER 667-26-2514
DOE CHERYL 706-87-5430
ROLLINS SARAH 770-25-8147
ANDERSON PETER 778-21-2847
THOMPSON LOUISE 819-95-6445
NOE JANE 880-25-3058
HENDERS GERALD 998-72-6203
GREENWOOD 102168101961EDU 002002000
IRVING 101750111855ENG 004004016
IRVING 101750111855ENG 098095375
GREENWOOD 102168101961EDU 003003009
ANDRUS 100478042855J0URN 005005010
ANDRUS 100478042855JOURN 004000000
ALLEN 102056012561LNGUIS 003003012
KLEIN 100987051260ENGIR 003003006
QUINTERA 90154101253BI0 003000000
IRVING 101750111855ENG 003003012
ANDRUS 100478042855J0URN 190173371
ANDRUS 100478042855J0URN 003003009
KING 100012090848BUS 005005015
ALLEN 102056012561LNGUIS 005000000
ALLEN 102056012561LNGUIS 025020077
ALLEN 102056012561LNGUIS 004004012
ALLEN 102056012561LNGUIS 005005020
KING 100012090848BUS 004004016
EBERHARD 102320061158BUS 005005015
EBERHARD 102320061158BUS 001001000
EBERHARD 102320061158BUS 004004016
KLEIN 100987051260ENGIR 005005015
EBERHARD 102320061158BUS 003003006
GIBSON 101728070160MATH 003000000
KLEIN 100987051260ENGIR 003003006
KLEIN 100987051260ENGIR 135135373
ANDERSEN 102308032160P0LISCI 005005015
ANDERSEN 102308032160P0LISCI 003003009
QUINTERA 90154101253810 180176607
UNGERMAN 100933120356PHYSED 150148445
ANDERSEN 102308032160P0LISCI 005005010
UNGERMAN 100933120356PHYSED 003003012
UNGERMAN 100933120356PHYSED 003003009
KING 100012090848BUS 002002006
KING 100012090848BUS 178174423
ANDRUS 100478042855J0URN 001001000
GREENWOOD 102168101961EDU 003003006
GREENWOOD 102168101961EDU 030030068
IRVING 101750111855ENG 003003009
GIBSON 101728070160MATH 145143290
GIBSON 101728070160MATH 005005010
QUINTERA 90154101253BI0 005005010
GOMEZ 102379022260C0MPSCI 003003009
GOMEZ 102379022260C0MPSCI 005005010
GOMEZ 102379022260C0MPSCI 002002008
GREENWOOD 102168101961EDU 005005020
QUINTERA 90154101253BIO 004004012
Figure 8-14. Output From Sort Using a Directive File Figure 8-16. File GRADES
1 1 1 3 1 5 2 1 2 7 3 6 3 9 4 2 4 5
LAST NAME
FIRST INITIAL
STUDENT
NO. DOB STUDY
MIDDLE INITIAL UNITS
ATTEMPTED
UNITS COMPLETED
GRADE POINTS
Figure 8-15. File GRADES Record Layout
8-6 60484800 B
Figure 8-17 shows the S0RT5 control statement with
the SUM parameter. The input and output files are
named, and the student number (character positions
15 through 20) is specified as the sort key. The
SUM parameter specifies that a 3-character numeric
field of type NUMERIC_NS begins in position 36 in
each record. The repetition indicator 3 specifies
that three contiguous fields are to be summed.
F i g u r e 8 - 1 8 s h o w s t h e o u t p u t f r o m t h e j o b . T h e
output file contains one record for each student.
The numeric fields are the totals of the units
attempted, units completed, and grade points.
A SORT USING PROCEDURE CALLS
Figure 8-19 shows the job structures for performing
a sort from within a FORTRAN program. Under both
NOS and NOS/BE, the job statements and accounting
information are followed by ATTACH commands to
a s s i g n t h e i n p u t d a t a l e ( U N I V E R ) a n d t h e l e
containing the FORTRAN source program to the job.
The FORTRAN 5 compiler is called, and the program
is compiled. The program is then executed (LGO).
Figure 8-20 shows the FORTRAN program containing
the Sort/Merge procedure calls. File UNIVER is
read, and student records with grade point average
of 3.50 or better are written to an intermediate
file (INT1). Sort/Merge is called to sort the file
on grade point average in descending order (highest
grade point average to lowest grade point aver
age). The SM5S0RT call names a result array that
is dimensioned as a 16-element integer array and
the first element set to 15 to receive the maximum
number of s o r t results and s t a tistics.
T h e S M 5 0 W N 1 c a l l s p e c i e s t h a t a n o w n c o d e 1
routine named CCODE is to be executed after Sort/
Merge reads each record from INT1. Records are
passed to the routine by Sort/Merge. Figure 8-21
shows the routine, which is a FORTRAN subroutine.
The SUBROUTINE statement names the routine and the
parameters passed by Sort/Merge. Parameter RETCODE
is t he r etur n _cod e pa s sed a s 0 , RE C is an a rra y
containing the record, and RL is the record length
in charact e rs. The routine converts the class c ode
in each record to the class name. The records are
r e t u r n e d t o S o r t / M e r g e i n a r r a y R E C . T h e
return_code value is left as 0 because each record
in this example is to be sorted. Sort/Merge then
s o r t s t h e r e c o r d s t o l e I N T 2 . T h e s o r t e d l e i s
returned to the FORTRAN program to be written out
in a formatted report. Figure 8-22 shows the
output from the job, which includes the report and
the contents of the result array.
'get,grades
/file(grades,bt=c,rt=z,f1=44)
FILE(GRADES,BT=C,RT=Z,FL=44)
/file(sumex,bt=c,rt=z,fl=44)
FILE(SUMEX,BT=C,RT=Z,FL=44)
/sortS.f rom=grades,to=sumex,key=15..20,sum=( (36,3,numeri c__ns,3))
SORT/MERGE 5 - 47 RECORDS SORTED
/
Figure 8-17. Interactive Parameter Specification for SUM Example
Total units completed
Total units attempted
I
Total grade points
1
QUINTERA 090154101253BI0 19218Ji.
5629
KING 100012090848BUS 189185460
ANDRUS 100478042855J0URN 203182390
UNGERMAN 100933120356PHYSED 156154466
KLEIN 100987051260ENGIR 146146400
GIBSON 101728070160MATH 153148300
IRVING 101750111855ENG 108105412
ALLEN 102056012561LNGUIS 042032121
GREENWOOD 102168101961EDU 043043103
ANDERSEN 102308032160P0LISCI 013013034
EBERHARD 102320061158BUS 013013037
GOMEZ 102379022260C0MPSCI 010010027
Figure 8-18. Output From SUM Example
60484800 B 8-7
NOS Operating System
Job statement
USER statement
CHARGE statement
ATTACH,UNIVER,SM5EX.
FILE(UNIVER,BT=C,RT=Z,FL=38)
FTN5,l=SM5EX,L=OUTEX.
LGO.
COPY,OUTEX,OUTPUT.
EOI
NOS/BE Operating System
Job statement
ACCOUNT statement
ATTACH,UNIVER,ID=PUBS.
ATTACH,SM5EX,ID=F.
FILE(UNIVER,BT=C,RT=Z,FL=38)
FTN5,l=SM5EX,L=OUTEX.
LGO.
COPY,OUTEX,OUTPUT.
EOI
Figure 8-19. Job Structure for Sort Called From a FORTRAN Program
1PROGRAM DLIST
2 INTEGER GPA
3CHARACTER SNAME*14, MAJ0R*8, C0DE*1, CLASS*12
4DIMENSION IARAY(16)
5COMMON /C0MN/ CODE, CLASS
6
7
8C
EXTERNAL CC0DE
1READ(L"UNIVER",100,END=10) SNAME, MAJOR, GPA, CODE
9IF (GPA .GE. 350) WRITE(L"INT1",200) SNAME, MAJOR, GPA, CODE
10 GO TO 1
11
12 10 IARAY(1)=15
13 CALL SM5S0RTUARAY)
14 CALL SM50FL(80)
15 CALL SM5FR0M('INT1')
16 CALL SMSKEY^^'ASCIU'^D')
17 CALL SM50WNKCC0DE)
18 CALL SM5TO(,INT2,)
19 CALL SM5END
20 REWIND(L"INT2")
21
22 PRINT *, IARAY
23 WRITECL"0UTEX",400)
24 15 READ(L,,INT2",300,END=20) SNAME, MAJOR, GPA, CLASS
25 WRITE(LMOUTEX",500) SNAME, MAJOR, CLASS, GPA
26 GO TO 15
27
28 100 FORMAT <A14,12X,A8,I3,A1)
29 200 FORMAT (A14,5X,A8,5X,I3,5X,A1,39X)
30 300 FORMAT <A14,5X,A8,5X,I3,5X,A12,28X)
31 400 FORMAT (36X,"DEAN'S LIST" // 15X,"STUDENT",
32 * 12X,"MAJOR",8X,"CLASS",12X,"GPA",65X /)
33 500 FORMAT (15X,A14,5X,A8,5X,A12,5X,I3,59X)
34
35 20 STOP
36 END
Figure 8-20. FORTRAN Program With Sort/Merge Procedure Calls
8-8 60484800 B
j4$Wm*\
SUBROUTINE CCODE(RETCODE,REC,RL)
3INTEGER RETCODE, RL
4CHARACTER C1*6, C2*6, C3*9, C4*8, C5*12,
5* C0DE*1, CLASS*12, REC(*)*12
6COMMON /SUBCOM/ CODE, CLASS
7D ATA C 1 , C 2 / ' S E N I 0 R ' , ' J U N I O R ' /
8DATA C3,C4/'SOPHOMORE','FRESHMAN'/
9DATA C5/'UNCLASSIFIED'/
10
11 CODE = REC(4)(5:5)
12 IF (CODE .EQ. '1') THEN
13 CLASS = C1
14 E L S E I F (C O D E . E Q . ' 2 ') T H E N
15 CLASS = C2
16 E L S E I F (C O D E . E Q . ' 3 ') T H E N
17 CLASS = C3
18 E L S E I F (C O D E . E Q . ' 4 ') T H E N
19 CLASS = C4
20 E L S E I F (C O D E . E Q . ' 5 ') T H E N
21 CLASS = C5
22 ELSE
23 PRINT *, CODE
24 END IF
25 REC(4)(5:12) = CLASS(1:8)
26 REC(5)(1:4) = CLASS(9:12)
27 RETURN
28 END
Figure 8-21. Owncode Routine
A. Report
DEAN'S L I S T
STUDENT MAJOR CLASS GPA
SHIELDS COMPSCI SENIOR 390
HORNE COMPSCI FRESHMAN 389
TERRELL ENG SENIOR 386
SMITH PHIL SOPHOMORE 385
SMITH MATH SENIOR 379
CLARK ECON JUNIOR 378
TIEMON LNGUIS SOPHOMORE 376
FRANKLIN PHIL JUNIOR 370
HANSEN BUS SOPHOMORE 358
DAVIS ENG SENIOR 354
SUGARMAN SOC SENIOR 350
B. Result Array
15 11 0 0
Element 1;
11 0 0 0 0 11 80 80 80
user set. Elements 2 thru 16; set by
Sort/Merge . See table 5-1.
Figure 8-22. Output From FORTRAN Program
0PS
60484800 B 8-9
<*%
CHARACTER DATA INPUT, OUTPUT, AND,
CENTRAL MEMORY REPRESENTATION
r
0^S
0*S
This appendix describes the code and character sets
used by host computer operating system local batch
device drivers, magnetic tape drivers, and terminal
communication products. Some software products
assume that certain graphic or control characters
are associated with specific binary code values for
collating or syntax processing purposes. This
appendix does not describe those associations.
All references within this manual to the ASCII
character set or the ASCII code set refer to the
character set and code set dened in the American
Na tional Standard Code for Information Interchange
(ASCII, ANSI Standard X3.4-1977). References in
this manual to the ASCII character set do not
n e c e s s a r i l y a p p l y t o t h e A S C I I c o d e s e t . S o r t /
Merge uses a 63- or 64-character subset of the full
ASCII set. Only characters in 6-bit or internal
BCD display code should be used with Sort/Merge.
CHARACTER SETS AND CODE SETS
A character set differs from a code set. A char
acter set is a set of graphic and/or control char
acters. A code set is a system of symbols used to
r e p r e s e n t e a c h ch a r a c t e r wi t hi n a c h a r a c t e r s e t .
Characters exist outside the computer system and
communication network; codes are received, stored,
retrieved, and transmitted within the computer
system and network.
GRAPHIC AND CONTROL
CHARACTERS
A graphic character can be displayed at a terminal
or printed by a line printer. Examples of graphic
characters are the characters A through Z, a blank,
and the digits 0 through 9. A control character
initiates, modifies, or stops a control operation.
An example of a control character is the backspace
character, which moves the terminal carriage or
cursor back one space. Although a control char
acter is not a graphic character, some terminals
can produce a graphic representation when they
receive a control character.
CODED AND BINARY
CHARACTER DATA
Character codes can be interpreted as coded char
acter data or as binary character data. Coded
c h a r a c t e r d a t a i s c o n v e r t e d f r o m o n e c o d e s e t
representation to another as it enters or leaves
the computer system; for example, data received
from a terminal or sent to a magnetic tape unit is
converted. Binary character data Is not converted
as it enters or leaves the system. Character codes
are not converted when moved within the system; for
example, data transferred to or from mass storage
is not converted.
The distinction between coded character data and
binary character data is important when reading or
60484800 B
punching cards and when reading or writing magnetic
tape. Only coded character data can be properly
reproduced as characters on a line printer. Only
binary character data can properly represent char
acters on a punched card when the data cannot be
stored as display code.
The distinction between binary character data and
characters represented by binary data (such as
peripheral equipment instruction codes) is also
important. Only such binary noncharacter data can
properly reproduce characters on a plotter.
FORMATTED AND UNFORMATTED
CHARACTER DATA
Character codes can be interpreted by a product as
f o r m a tt e d c ha r a c te r d a ta o r a s u n f o r ma t t e d c h a r
acter data. Formatted data can be stored or
retrieved by a product in the form of the codes
described for coded character data in the remainder
of this appendix, or formatted data can be altered
to another form during storage or retrieval; for
example, 1 can be stored as a character code or as
an integer value. Treatment of unformatted data by
a product includes both coded character data and
binary character data as described in this appendix.
NETWORK OPERATING SYSTEMS
The NOS and NOS/BE operating systems support the
following character sets:
CDC graphic 64-character set
CDC graphic 63-character set
ASCII graphic 64-character set
ASCII graphic 63-character set
ASCII graphic 95-character set
In addition, NOS supports the ASCII 128-character
graphic and control set.
Each installation must select either a 64-character
set or a 63-character set. The differences between
the codes of a 63-character set and the codes of a
64-character set are described under Character Set
Anomalies. Any reference in this appendix to a 64-
character set implies either a 63- or 64-character
set unless otherwise stated.
To represent its six listed character sets in
ce n t r a l me mo ry, NO S s u p p o r ts t h e fo ll o w i n g co de
sets:
6-bit display code
12-bit ASCII code
6/12-bit display code
A-l
To represent its five listed character sets in
central memory, NOS/BE supports the following code
sets:
6-bit display code
12-bit ASCII code
Under both NOS and NOS/BE, the 6-bit display code
is a set of 6-bit codes from OOg to 77s.
Under both NOS and NOS/BE, the 12-bit ASCII code is
the ASCII 7-bit code (as dened by ANSI Standard
X3.4-1977) right-justified in a 12-bit byte.
Assuming that the bits are numbered from the right
starting with 0, bits 0 through 6 contain the ASCII
code, bits 7 through 10 contain zeros, and bit 11
distinguishes the 12-bit ASCII 00008 code from
the end-of-line byte. The 12-bit codes are OOOlg
through 01778 and 4000g.
Under NOS, the 6/12-bit display code is a combina
tion of 6-bit codes and 12-bit codes. The 6-bit
codes are OOg through 77g, excluding 748 and
76g. (The interpretation of the 008 and 63s
codes is described under Character Set Anomalies in
this appendix.) The 12-bit codes begin with either
74g or 768 and are followed by a 6-bit code.
Thus, 74g and 76g are considered escape codes
a n d a r e n e v e r u s e d a s 6 - b i t c o d e s w i t h i n t h e
6/12-bit display code set. The 12-bit codes are
74018, 74028, 74048, 74078, and 76018
through 76778. All other 12-bit codes (74xx8
and 7600g) are undefined.
CHARACTER SET ANOMALIES
The operating system input/output software and some
products interpret two codes differently when the
installation selects a 63-character set rather than
a 64-character set. If an installation uses a
63-character set, the colon graphic character is
always represented by a 638 display code, display
code 008 is undefined (it has no associated
graphic or punched card code), and the % graphic
does not exist.
However, under NOS, if the installation uses a
64-character set, output of a 74048 6/12-bit
d i s p l a y c o d e o r a O O g d i s p l a y c o d e p r o d u c e s a
c o l o n . A c o l o n c a n b e i n p u t o n l y a s a 7 4 0 4 8
6/12-bit display code. The use of undefined
6/12-bit display codes in output files produces
unpredictable results and should be avoided.
Under NOS/BE, if the installation uses a 64-
character set, output of a OOg display code
produces a colon. Display code 638 is the colon
when a 63-character set is used. The % graphic and
related card codes do not exist and translations
yield a blank (558).
Under both NOS and NOS/BE, two consecutive OOg
codes can be confused with an end-of-line byte and
should be avoided.
CHARACTER SET TABLES
The character set tables A-l and A-2 are designed
so that you can nd the character represented by a
code (such as in a dump) or find the code that
represents a character. To find the character
represented by a code, look up the code in the
column listing the appropriate code set and then
find the character on that line in the column
l i s t i n g t h e a p p r op r i a t e c h a ra c te r s e t . To n d t h e
code that represents a character, look up the
character and then find the code on the same line
in the appropriate column.
Conversational Terminal Users
Table A-l shows the character sets and code sets
a v a i l a b l e t o a n I n t e r a c t i v e F a c i l i t y ( I A F ) o r
INTERCOM user at an ASCII code terminal using an
ASCII character set. The Full ASCII Character Set
table (later in this appendix) shows the octal and
hexadecimal 7-bit ASCII code for each ASCII char
acter, and can be used to convert codes from octal
to hexadecimal. (Under NOS using network product
software, certain Terminal Interface Program com
mands require specification of an ASCII code.
IAF Usage
When in normal time-sharing mode (specified by the
IAF NORMAL command), IAF assumes the ASCII graphic
64-character set is used and translates all input
and output to or from display code. When in ASCII
time-sharing mode (specified by the IAF ASCII
command), IAF assumes the ASCII 128-character set
is us e d a nd tr a ns l at es all in pu t a n d o ut p ut to or
from 6/12-bit display code.
The IAF user can convert a 6/12-bit code le to a
12-bit ASCII code file using the NOS FCOPY control
statement. The resulting 12-bit ASCII file can be
routed to a line printer but cannot be output
through IAF.
IAF supports both character mode and transparent
mode transmissions through the network. These
t r a n s m i s s i o n m o d e s a r e d e s c r i b e d u n d e r N e t w or k
Access Method Terminal Transmission Code Sets in
this appendix. IAF treats character mode trans
missions as coded character data; IAF converts
these transmissions to or from either 6-bit or
6/12-bit display code. IAF treats transparent mode
transmissions as binary character data; transparent
mode communication between IAF and ASCII terminals
using any parity setting occurs in the 12-bit ASCII
code shown in table A-l.
INTERCOM Usage
By default, INTERCOM displays the ASCII graphic
64-character set and interprets all input and
output as display code. Refer to the INTERCOM
reference manual*
COMPASS and FORTRAN users can elect to use 12-bit
ASCII code if the terminal in use supports the code
set selected. BASIC users can elect to send and
receive lowercase and uppercase character codes
using the 12-bit ASCII code if the terminal in use
supports the code set selected; BASIC represents
c o d e d c h a r a c t e r d a t a i n c e n t r a l m e m o r y u s i n g
6/12-bit display code in both the NOS and NOS/BE
systems.
A-2 60484800 B
TABLE A-l. CONVERSATIONAL TERMINAL CHARACTER SETS
^S
r
ASCII ASCII Octal Octal Octal ASCII ASCII Octal Octal Octal
Graphic Character 6-Bit 6/12-Bit 12-Bit Graphic Character 6-Bit 6/12-Bit 12-Bit
(64-Char (128-Char- Display Display ASCII (64-Char (128-Char- Display Display ASCII
acter Set) acter Set) Code Code* Code acter S e t ) a c t e r S e t ) Code Codet Code
: c o l o n n 00" **" circumflex 7402 0136
A A 01 01 0101 : colon" 7404tt 0072
B B 02 02 0102 * grave accent 7407 0140
CC03 03 0103 7601 0141
D D 04 04 0104 7602 0142
E E 05 05 0105 7603 0143
FF06 06 0106 7604 0144
G G 07 07 0107 7605 0145
H H 10 10 0110 7606 0146
I I 11 11 0111 7607 1047
J J 12 12 0112 7610 0150
K K 13 13 0113 7611 0151
L L 14 14 0114 7612 0152
M M 15 15 0115 7613 0153
N N 16 16 0116 7614 0154
0 0 17 17 0117 ra 7615 0155
P P 20 20 0120 7616 0156
QQ21 21 0121 7617 0157
R R 22 22 0122 7620 0160
S S 23 23 0123 7621 0161
T T 24 24 0124 7622 0162
U U 25 25 0125 7623 0163
V V 26 26 0126 7624 0164
Ww27 27 0127 7625 0165
XX30 30 0130 7626 0166
Y Y 31 31 0131 7627 0167
ZZ32 32 0132 7630 0170
0 0 33 33 0060 7631 0171
1134 34 0061 7632 0172
2 2 35 35 0062 C left brace 7633 0173
3 3 36 36 0063 | v e r t , l i n e 7634 0174
4 4 37 37 0064 > right brace 7635 0175
5 5 40 40 0065 " tilde 7636 0176
6641 41 0066 NUL 7640 4000
7 7 42 42 0067 SOH 7641 0001
8 8 43 43 0070 STX 7642 0002
9 9 44 44 0071 ETX 7643 0003
+ plus + p lus 45 45 0053 EOT 7644 0004
- minus - minus 46 46 0055 ENQ 7645 0005
* asterisk * asterisk 47 47 0052 ACK 7646 0006
/ slash / slash 50 50 0057 BEL 7647 0007
( I . p a r e n . ( I . p a r e n . 51 51 0050 BS 7650 0010
) r. p a r e n . ) r. p a r e n . 52 52 0051 HT 7651 0011
$ dollar $ dollar 53 53 0044 LF 7652 0012
= equal to = equa l to 54 54 0075 VT 7653 0013
space space 55 55 0040 FF 7654 0014
, comma , comma 56 56 0054 CR 7655 0015
. period . period 57 57 0056 SO 7656 0016
tt number ft number 60 60 0043 SI 7657 0017
H 1. bracket H 1. bracket 61 61 0133 DEL 7637 0177
1 r. b r a c k e t ] r. b r a c k e t 62 62 0135 DLE 7660 0020
X p e r c e n t " % percent1* 63" 63" 0045 DC1 7661 0021
" quote " q u ote 64 64 0042 DC2 7662 0022
_ underline _ underline 65 65 0137 DC3 7663 0023
! exclam. ! exclam. 66 66 0041 DC4 7664 0024
& ampersand & ampersand 67 67 0046 NAK 7665 0025
apostrophe ' apostro phe 70 70 0047 SYN 7666 0026
? question ? question 71 71 0077 ETB 7667 0027
< less than < less than 72 72 0074 CAN 7670 0030
> g r t r. t h a n > g r t r. t h a n 73 73 0076 EM 7671 0031
a coml. at 74 SUB 7672 0032
\ r e v. s l a n t \ r e v. s l a n t 75 75 0134 ESC 7673 0033
* circumflex 76 FS 7674 0034
; sem ico lon ; sem ico lon 77 77 0073 GS 7675 0035
3 com I. a t 7401 0100 RS
US
7676
7677
0036
0037
^Generally available only on NOS, or through BASIC on NOS/BE.
" T h e i n t e r p re t a t i o n o f t h i s charac ter or coc e depends on its context. Refer to Character Set Anomalies in
the text.
60484800 B A-3
TABLE A-2. LOCAL BATCH DEVICE CHARACTER SETS
CDC ASCII ASCII Octal Octal Octal Card Keypunch Code
Graphic
(64-Character
Graphic
(64-Character
Graphic
(95-Character
6-Bit 6/12-Bit
Display
12-Bit
ASCII
Display 026 029
Set) Set) Set) Code Codet Code
: c o l o n " : c o l o n " 00" 8-2 8-2
AA A 01 01 0101 12-1 12-1
B B B02 02 0102 12-2 12-2
CCC 03 03 0103 12-3 12-3
D D D 04 04 0104 12-4 12-4
EEE 05 05 0105 12-5 12-5
FFF 06 06 0106 12-6 12-6
G G G 07 07 0107 12-7 12-7
H H H 10 10 0110 12-8 12-8
III 11 11 0111 12-9 12-9
J J J 12 12 0112 11-1 11-1
K K K 13 13 0113 11-2 11-2
L L L 14 14 0114 11-3 11-3
M M M 15 15 0115 11-4 11-4
NN N 16 16 0116 11- 5 11-5
0 0 0 17 17 0117 11 - 6 11-6
P P P 20 20 0120 11-7 11-7
Q Q Q 21 21 0121 11-8 11-8
R R R 22 22 0122 11 - 9 11-9
S S S 23 23 0123 0-2 0-2
T T T 24 24 0124 0-3 0-3
U U U 25 25 0125 0-4 0-4
V V V 26 26 0126 0-5 0-5
u u W27 27 0127 0-6 0-6
X X X 30 30 0130 0-7 0-7
YY Y 31 31 0131 0-8 0-8
zZ Z 32 32 0132 0-9 0-9
0 0 0 33 33 0060
1 1 134 34 0061
2 2 2 35 35 0062
333 36 36 0063
44437 37 0064
555 40 40 0065
666 41 41 0066
77 7 42 42 0067
888 43 43 0070
9 9 9 44 44 0071
+ plus + plus + plus 45 45 0053 12 12-8-6
- minus - minus - minus 46 46 0055 11 11
* asterisk * a st er i sk * as t er is k 47 47 0052 11-8-4 11-8-4
/ slash / s l a sh / s lash 50 50 0057 0-1 0-1
( Left paren. ( left paren. ( left paren. 51 51 0050 0-8-4 12-8-5
> right paren. ) right paren. ) right paren. 52 52 0051 12-8-4 11-8-5
$ do l l a r $ d o l l a r $ d o l lar 53 53 0044 11 -8- 3 11-8-3
= equal to = equal to = equal to 54 54 0075 8-3 8-6
space space space 55 55 0040 no punch no punch
, comma , comma , comma 56 56 0054 0-8-3 0-8-3
. period . peri od . peri od 57 57 0056 12-8-3 12-8-3
= equivalence # number # number 60 60 0043 0-8-6 8-3
Z left bracket C left bracket C I. bracket 61 61 0133 8-7 12-8-2
or 12-Ot"
1 right bracket 1 right b r acket ] r. b r ac ke t 62 62 0135 0-8-2 11-8-2
or 11-0"t
% percent" X p ercent" X pe rcent" 63" 63" 0045 8-6 0-8-4
A-4 60484800 B
TABLE A-2. LOCAL BATCH DEVICE CHARACTER SETS (Contd)
0m*s
CDC
Graphic
(64-Character
Set)
t* not equal
r*concat.
V logical OR
A logical AND
t superscript
I subscript
< less than
> greater than
£ Less/equal
>^ greater/equal
—i logical NOT
; semicolon
ASCII
Graphic
(64-Character
Set)
quote
underline
! exclamation
& ampersand
' apostrophe
? question
< less than
> greater than
3 commercial at
\ reverse slant
circumflex
semicolon
ASCII
Graphic
(95-Character
Set)
" quote
underline
! exclamation
& ampersand
' apostrophe
? question
< less than
> greater than
\ r e v. s l a nt
; semicolon
S com I. at
-*• circumflex
: colon
' grave accent
a
b
c
d
e
f
g
h
i
j
k
I
m
n
o
P
q
r
s
t
u
V
w
X
y
z
•C left brace
| vert, line
> right brace
" tilde
Octal
6 - B i t
Display
Code
64
65
66
67
70
71
72
73
74
75
76
77
Octal
6/12-Bit
Display
Codet
tGenerally available only on NOS, or through BASIC on NOS/BE.
64
65
66
67
70
71
72
73
75
77
7401
7402
7404
7407
7601
7602
7603
7604
7605
7606
7607
7610
7611
7612
7613
7614
7615
7616
7617
7620
7621
7622
7623
7624
7625
7626
7627
7630
7631
7632
7633
7634
7635
7636
Octal
12-Bit
ASCII
Code
0042
0137
0041
0046
0047
0077
0074
0076
0134
0073
0100
0136
0072
0140
0141
0142
0143
0144
0145
0146
0147
0150
0151
0152
0153
0154
0155
0156
0157
0160
0161
0162
0163
0164
0165
0166
0167
0170
0171
0172
0173
0174
0175
0176
Card Keypunch Code
026
12-8-7
029
8-4 8_7R
0-8-5 0-8-5§
or
11-0
11-o§ 12-8-7
or
11-8-2
0-8-7 12
11-8-5 8-5
11-8-6 0-8-7
12-0 12-8-4
11-8-7 0-8-6
8-5 8-4
12-8-5 0-8-2
12-8-6 11-8-7
11-8-6
tt The interpretation of this character or code depends on its context. Refer to Character Set Anomalies
i n t h e t e x t .
"t Available for input only, on NOS.
§ Available for input only, on NOS/BE.
60484800 B A-5
Local Batch Users
Table A-2 lists the CDC graphic 64-character set,
the ASCII graphic 64-character set, and the ASCII
graphic 95-character set. This table also lists
the code sets and card keypunch codes (026 and 029)
that represent the characters.
The 64-character sets use display code as their
code set; the 95-character set uses 12-bit ASCII
code. The 95-character set is composed of all the
characters in the ASCII 128-character set that can
be printed at a line printer (refer to Line Printer
O u t p u t ) . O n l y 1 2 - b i t A S C I I c o d e l e s c a n b e
printed using the ASCII graphic 95-character set.
To p r i n t a 6 / 1 2 - b i t d i s p l a y c o d e l e ( u s u a l l y
created in IAF ASCII mode), you must convert the
file to 12-bit ASCII code. To do this, the NOS
FCOPY control statement must be issued. The
95-character set Is represented by the 12-bit ASCII
codes 00408 through 01768.
Line Printer Output
The batch character set printed depends on the
print train used on the line printer to which the
file is sent. The following are the print trains
corresponding to each of the batch character sets:
Character Set
CDC graphic 64-character set
ASCII graphic 64-character set
ASCII graphic 95-character set
P r i n t
Train
596-1
596-5
596-6
The characters of the default 596-1 print train are
listed in the table A-2 column labeled CDC Graphic
(64-Character); the 596-5 print train characters
are listed in the table A-2 column labeled ASCII
Graphic (64-Character); and the 596-6 print train
characters are listed in the table A-2 column
labeled ASCII Graphic (95-Character).
If a transmission error occurs during the printing
o f a l i n e , N O S p r i n t s t h e l i n e a g a i n . T h e C D C
g r a p h ic p ri n t t ra i n p r i n t s a co n c a t e na t i o n s y m b ol
( r * ) i n t h e fi r s t p r i n t a b l e c o l u m n o f a l i n e
containing errors. The ASCII print trains print an
underline instead of the concatenation symbol.
If an unprintable character exists in a line (that
is, a 12-bit ASCII code outside of the range
00408 through 01768), the number sign (i?)
a p p e a r s i n t h e r s t p r i n t a b l e c o l u m n o f a p r i n t
line and a space replaces the unprintable character.
Punched Card Input and Output
Under NOS, coded character data is exchanged with
local batch card readers or card punches according
to the translations shown in table A-2. As indi
cated in the table, additional card keypunch codes
are available for input of the ASCII and CDC char
acters [ and ]. The 95-character set cannot be
read or punched as coded character data.
Depending on an installation or deadstart option,
NOS assumes an input deck has been punched either
In 026 or 029 keypunch code (regardless of the
character set in use). The alternate keypunch
codes can be specified by a 26 or 29 punched in
columns 79 and 80 of any job card, 6/7/9 card, or
7/8/9 card. The specified code translation remains
in effect throughout the job unless it is reset by
specification of the alternate code translation on
a subsequent 6/7/9 card or 7/8/9 card.
NOS keypunch code translation can also be changed
by a card containing a 5/7/9 punch in column 1. A
blank (no punch) in column 2 indicates 026 conver
sion mode; a 9 punch in column 2 indicates 029
conversion mode. The conversion change remains in
effect unti l ano ther change card is encountered or
the job ends.
The 5/7/9 card also allows literal input when
4/5/6/7/8/9 is punched in column 2. Literal input
can be used to read 80-column binary character data
within a punched card deck of coded character data.
L i t e r a l c a r d s a r e s t o r e d w i t h e a c h c o l u m n i n a
12-bit byte (a row 12 punch is represented by a 1
in b it 11, r ow 11 b y b i t 1 0 , ro w 0 by b it 9 , a n d
rows 1 through 9 by bits 8 through 0 of the byte),
16 central memory words per card. Literal input
cards are read until a card identical to the pre
vious 5/7/9 card (4/5/6/7/8/9 in column 2) is
read. The next card can specify a new conversion
mode.
Under NOS/BE, coded character data is exchanged
w i t h l o c a l b a t c h c a r d r e a d e r s o r c a r d p u n c h e s
according to the translations shown in table A-2.
As indicated in the table, additional card keypunch
codes are available for input of the CDC characters
V and < or their ASCII equivalents ! and <. The
95-character set cannot be read or punched as coded
character data.
Depending on an installation option, NOS/BE assumes
an input deck has been punched either in 026 or in
029 keypunch code (regardless of the character set
in use). The alternate keypunch codes can be
specied by a 26 or 29 punched in columns 79 and
80 of the job statement or In columns 79 and 80 of
a n y 7 / 8 / 9 c a r d . T h e s p e c i e d c o d e t r a n s l a t i o n
remains in effect throughout the job unless it is
reset by specification of the alternate code
translation on a subsequent 7/8/9 card.
Under NOS/BE, a card with all of column 1 punched
(that is, 12 punches in column 1) and all of one
other column punched can be followed by 80-column
cards of free-form binary data. These binary data
cards are read or punched as described for NOS
literal data until another card with 12 punches in
column 1 and in one other column occurs, or until
the job ends. The next card is interpreted as
coded data.
Remote Batch Users
When card decks are read from remote batch devices,
the ability to select alternate keypunch code
translations depends upon the remote terminal
equipment.
<-/^\
A-6 60484800 B
NOS Usage
Remote batch terminal line printer, punched card,
and plotter character set support is described in
the Remote Batch Facility (RBF) reference manual.
RBF supports only character mode transmission to
and from conso l e s through t h e network. Character
mode Is described under Network Access Method
Terminal Transmission Code Sets in this appendix.
NOS/BE Usage
The remote batch terminal line printer, punched
card, and plotter character set support is de
scribed in the INTERCOM reference manual.
Magnetic Tape Users
Coded character data to be copied from mass storage
to magnetic tape is assumed to be represented in
display code. NOS converts the data to external
BCD code when writing a coded 7-track tape and to
ASCII or EBCDIC code (as specified on the tape
assignment statement) when writing a coded 9-track
tape.
Because only 63 characters can be represented in
7-track even parity, one of the 64 display codes is
lost in conversion to and from external BCD code.
Figure A-l shows the differences in conversion that
depend on which character set (63 or 64) the system
uses. The ASCII character for the specified char
acter code is shown in parentheses. The output
arrow shows how the display code changes when it is
written on tape in external BCD. The input arrow
shows how the external BCD code changes when the
tape is read and converted to display code.
63-Character Set
Display Code External BCD
16(%)
Output 12(0)
12(0)
Display Code
00
33(0)
63(:)
00
Input 33(0)
33(0)
64-Character Set
Display Code External BCD
12(0)
Output 12(0)
16(%)
Display Code
00(:)
33(0)
63(%)
33(0)
Input 33(0)
63(%)
Figure A-1. Magnetic Tape Code Conversions
Tables A-3 and A-4 show the character set conver
sions for 9-track tapes. Table A-3 lists the
conversions to and from 7-bit ASCII character code
and 6-bit display code. Table A-4 lists the
conversions between 8-bit EBCDIC character code and
6-bit display code. Table A-5 shows the character
set conversions between 6-bit external BCD and
6-bit display code for 7-track tapes.
If a lowercase ASCII or EBCDIC code is read from a
9 - t r a ck c o d ed t ap e , i t i s c o n ve r t e d t o it s u p pe r
case 6-bit display code equivalent. To read and
write lowercase ASCII or EBCDIC characters, the
user must assign the tape in binary mode and then
convert the binary character data.
During binary character data transfers to or from
9-track magnetic tape, the 7-bit ASCII codes shown
in table A-6 are read or written unchanged; the
8-bit hexadecimal EBCDIC codes shown in table A-7
al so can be read or written uncha nged. ASCII an d
EBCDIC codes cannot be read or written to 7-track
magnetic tape as binary character data.
Two CDC utility products, FORM and the 8-Bit Sub
routines, can be used to convert to and from EBCDIC
data. Table A-7 contains the octal values of each
EBCDIC code right-justified in a 12-bit byte with
zero fill. This 12-bit EBCDIC code can also be
produced using FORM and the 8-Bit Subroutines.
NETWORK ACCESS METHOD TERMINAL
TRANSMISSION CODE SETS
There are two modes in which coded character data
can be exchanged with a network terminal console.
These two modes, character mode and transparent
mode, correspond to the type of character code
editing and translation performed by the network
software during input and output operations. The
transmission mode used by the network software for
input can be selected by the terminal operator,
using a Terminal Interface Program command
(sometimes referred to as a terminal definition
command). The transmission mode used by the
network software for output can be selected by the
application program providing the terminal facility
service.
Character Mode Transmissions
Character mode is the initial and default mode used
for both input and output transmissions. When the
network software services the terminal in character
mode, it translates input characters from the
transmission code used by the terminal into the
ASCII code shown in table A-6. The translation of
a specific transmission code to a specific ASCII
code depends on the terminal class the network
software associates with the terminal. In char
acter mode input, the parity of the terminal
transmission code is not preserved in the corres
ponding ASCII code; the ASCII code received by the
terminal-servicing facility program always has its
eighth bit set to zero.
Character mode output is translated in a similar
manner. The network software provides the parity
bit setting appropriate for the terminal being
serviced, even though translating from ASCII char
acters with zero parity bit settings.
The general case for code translations of character
mode data is summarized in the following para
graphs. This generalized description permits use
of only table A-6 to explain all specific cases.
You can logically extend this generalized descrip
tion to allow use of tables A-l through A-5 as
descriptions of character set mapping for various
functions initiated from a terminal. Tables A-l
through A-5 are provided for your use while coding
an application program to run under the operating
s y s t e m . T h e y d o n o t d e s c r i b e c h a r a c t e r t r a n s
missions between an application program and the
network.
60484800 B A-7
TABLE A-3. ASCII 9-TRACK CODED TAPE CONVERSION
ASCII ASCII
Display Display
Code Character and Codet" Code Character and Code"t
Conversion* Code Conversion" Conversion' Code Conversion"
Code Char Code Char ASCII Code Code Char Code Char ASCII Code
(Hex) (Hex) Char (Octal) (Hex) (Hex) Char (Octal)
20 space 00 NUL space 55 40 60 74
21 7D 66 41 61 01
22 ii 02 STX ii 64 42 62 02
23 03 ETX tt 60 43 63 03
24 04 EOT 53 44 64 04
25 05 ENQ 63 45 65 05
25 05 ENQ space 55 46 66 06
26 06 ACK 67 47 67 07
27 07 BEL 70 48 68 10
28 08 BS 51 49 69 11
29 09 HT 52 4A 6A 12
2A 0A LF 47 4B 6B 13
2B OB VT 45 4C 6C 14
2C OC FF 56 4D 6D 15
2D 0D CR 46 4E 6E 16
2E 0E SO 57 4F 6F 17
2F OF SI 50 50 70 20
30 10 DLE 33 51 71 21
31 11 DC1 34 52 72 22
32 12 DC2 35 53 73 23
33 13 DC3 36 54 74 24
34 14 DC4 37 55 75 25
35 15 NAK 40 56 76 26
36 16 SYN 41 57 77 27
37 17 ETB 42 58 78 30
38 18 CAN 43 59 79 31
39 19 EM 44 5A 7A 32
3A 1A SUB 00 5B 1C FS r. 61
Display code 00 is undefined at sites using the 5C 7C 75
63-character set. 5D 01 SOH 62
3A 1A SUB 63 5E J< 7E AU 76
3B 1B ESC 77 5F 7F DEL 65
3C 7B 72
3D 1D GS 54
3E 1E RS 73
3F 1F US 71
twhen these characters are copied from or to a tape, the characters remain the same and the code changes
from/to ASCII to/from display code.
ttThese characters do not exist in display code. When the characters are copied from a tape, each ASCII
character is changed to an alternate display code c laracter. The corresponding codes are also changed.
Example: When the system copies a lowercase a, 61<| 5, from tape, it writes an uppercase A, 018.
'"A display code space always translates to an ASCII space.
Table A-6 contains the ASCII 128-character set
supported by the Network Access Method. A 96-
character subset consists of the rightmost six
columns and . includes the 95-character graphic
subset referenced previously in this appendix; the
deletion character (DEL) is not a graphic char
acter. A 64-character subset consists of the
middle four columns. Note that 6-bit display code
equivalents exist for the characters in this 64-
character subset only.
A l t h o u g h t h e n e t w o r k s u p p o r t s t h e 1 2 8 - c h a r a c t e r
set, some terminals restrict output to a smaller
subset. This restriction is supported by replacing
the control characters in columns 0 and 1 of table
A-6 with blanks to produce the 96-character subset,
and, additionally, replacing the characters in
columns 6 and 7 with the corresponding characters
from columns 4 and 5, respectively, to produce the
64-character subset.
A-8 60484800 B
TABLE A-4. EBCDIC 9-TRACK CODED TAPE CONVERSION
0ms
EBCDIC EBCDIC
Code
Conversiont
Character and
Code Conversion"
Display
Codet" Code
Conversiont
Character and
Code Conversion^
Display
Codet"
Code Char Code Char ASCII Code Code Char Code Char ASCII Code
(Hex) (Hex) Char (Octal) (Hex) (Hex) Char (Octal)
40 space 00 NUL space 55 C6 86 06
4A 1C IFS 61 C7 87 07
4B 0E SO 57 C8 88 10
4C CO {. 72 C9 89 11
4D 16 BS 51 D1 91 12
4E 0B VT 45 D2 92 13
4F DO 66 D3 93 14
50 2E ACK 67 D4 94 15
5A 01 SOH 62 D5 95 16
5B 37 EOT 53 D6 96 17
5C 25 LF 47 D7 97 20
5D 05 HT 52 D8 98 21
5E 27 ESC 77 D9 99 22
5F —« A1 ** 76 E0 6A 75
60 0D CR 46 E2 A2 23
61 OF SI 50 E3 A3 24
6B OC FF 56 E4 A4 25
6C 2D ENQ 63 E5 A5 26
6C 2D ENQ space 55 E6 A6 27
6D 07 DEL 65 E7 A7 30
6E 1E IRS >" 73 E8 A8 31
6F 1F IUS 71 E9 A9 32
7A 3F SUB : 00 FO 10 DLE 33
Display code 00 is undefined at sites using the F1 11 DC1 34
63-character set. F2 12 DC2 35
7A 3F SUB 63 F3 13 TM 36
7B 03 ETX tt 60 F4 3C DC4 37
7C 79 74 F5 3D NAK 40
7D 2F BEL 70 F6 32 SYN 41
7E 1D IGS 54 F7 26 ETB 42
7F ti 02 STX ii 64 F8 18 CAN 43
C1 81 01 F9 19 EM 44
C2 82 02
C3 83 03
C4 84 04
C5 85 05
'All EBCDIC codes not listed translate to display code 558 (space). A display code space always
translates to an EBCDIC space.
"These characters do not exist in display code. When the characters are copied from a tape, each EBCDIC
character is changed to an alternate display code character. The corresponding codes are also changed.
Example: When the system copies a lowercase a, 81<|£, from tape, it writes an uppercase A/ 018.
"•When these characters are copied from or to a tape, the characters remain the same (except EBCDIC codes
*A16r 4F"16/ 5A-|6, and 5F<|0) and the code changes from/to EBCDIC to/f rom display code.
Sim ilarly, inpu t from a device may be li mited to a
smaller subset by the device itself because the
de v ic e c a nn o t p rod uce th e f u ll 12 8 -c h ar a ct e r s et.
A character input from a device using a character
set other than ASCII is converted to an equivalent
ASCII character; characters without ASCII character
equivalents are replaced by the ASCII blank char
acter.
An application can also cause character replacement
(as described previously for output) as well as
character conversion, by requesting display-coded
input from the network.
The 7-bit hexadecimal code value for each character
consists of the character's column number in the
table, followed by its row number. For example, N
is in row E of column 4, so its value is 4Ejg.
60484800 B A-9
TABLE A-5. 7-TRACK CODED TAPE CONVERSIONS
External ASCII Octal Display External ASCII Octal Display
BCD Character Code BCD Character Code
01 34 40 46
02 35 41 12
03 36 42 13
04 37 43 14
05 40 44 15
06 41 45 16
07 42 46 17
10 43 47 20
11 44 50 21
12t 33 51 22
13 54 52 66
14 •i 64 53 53
15 74 54 47
16t 63 55 70
17 61 56 71
20 space 55 57 73
21 50 60 45
22 23 61 01
23 24 62 02
24 25 63 03
25 26 64 04
26 27 65 05
27 30 66 06
30 31 67 07
31 32 70 10
32 62 71 11
33 56 72 72
34 51 73 57
35 65 74 52
36 60 75 75
37 67 76 AU. 76
77 77
tAs explained in the text of this appendix, conversion of these codes depends on whether the tape is
being read or written.
Transparent Mode Transmissions
Transparent mode is selected separately for input
and output transmissions. During transparent mode
input, the parity bit is stripped from each ter
minal transmission code (unless the N parity option
has been selected by a Terminal Interface Program
command), and the transmission code is placed in an
8 - b i t b y t e w i t h o u t t r a n s l a t i o n t o 7 - b i t A S C I I
code. Line transmission protocol characters are
deleted from a mode 4C terminal input stream.
When the 8-bit bytes arrive in the host computer, a
terminal servicing facility program such as the
I n t e r a c t i v e F a c i l i t y c a n r i g h t - j u s t i f y t h e b y t e s
within a 12-bit byte. Upon transmission of 12-bit
by t es f rom th e h o st c om p ute r, th e l e ftm o st 4 b i ts
(bits 11 through 8) are discarded.
During transparent mode output, processing similar
to that performed for input occurs. The code in
each 8-bit byte received by the network software
from the terminal servicing facility program is not
translated. The parity bit appropriate for the
te rm i n a l cl a s s b e i n g us e d is al te re d a s i n d ic at ed
b y t h e p a r i t y o p t i o n i n e f f e c t f o r t h e t e r m i n a l .
The codes are then output in transmission bytes
appropriate for the codes associated with the
terminal class being used. Line transmission
p r o t oc o l c h a r a c t e r s a r e i n s e r t e d i n t o a m o d e 4 C
terminal output stream.
A-10 60484800 B
*ms
//ms
TABLE A-6. FULL ASCII CHARACTER SET
•128-Character Set
•96-Character Subset
-64-Character Subset-
J ^ N
Bits b 4 b 3 b 2 b 1
0 0 0 0
000 1
0 0 1 0
0011
010 0
0 1 0 1
011 0
0111
0 0 0
001
010
0 1 1
1 0 0
1 0 1
1 1 0
1 1 1
Column
Row
NUL
000
SOH
001
STX
002
ETX
003
EOT
004
ENQ
005
ACK
006
BEL
007
BS
010
HT
011
LF
012
VT
013
FF
014
CR
015
SO
016
SI
017
DLE
020
DC1
021
DC2
022
DC3
023
DC4
024
NAK
025
SYN
026
ETB
027
CAN
030
EM
031
SUB
032
ESC
033
FS
034
GS
035
RS
036
US
037
SP
040
041
it
042
#
043
$
044
%
045
&
046
047
(
050
)
051
*
052
+
053
054
055
056
/
057
060
1
061
2
062
3
063
4
064
5
065
6
066
7
067
8
070
9
071
072
073
<
074
075
>
076
077
100
A
101
B
102
C
103
D
104
E
105
F
106
G
107
H
110
I
111
J
112
K
113
L
114
M
11 5
N
11 6
0
11 7
120
Q
121
R
122
S
123
T
124
U
125
V
126
W
127
X
130
Y
131
Z
132
C
133
\
134
1
135
136
137
140
a
141
b
142
c
143
d
144
e
145
f
146
g
147
h
150
i
151
j
152
k
153
I
154
m
155
n
156
o
157
160
q
161
r
162
s
163
t
164
u
165
v
166
w
167
x
170
y
171
z
172
C
173
174
>
175
176
DEL
177
LEGEND:
Numbers under characters are the octal values for the 7-bit character codes used within the network.
60484800 B A-ll
TABLE A-7. FULL EBCDIC CHARACTER SET
Hexa
decimal
EBCDIC
Code
Octal
12-Bit
EBCDIC
Code
EBCDIC
Graphic
Charactert
EBCDIC
Control
Character
Hexa
decimal
EBCDIC
Code
Octal
12-Bit
EBCDIC
Code
EBCDIC
Graphic
Charactert
EBCDIC
Control
Character
00 OOOO NUL 41 0101 undefined
01 0001 SOH t h r u t h r u
02 0002 STX 49 0111
03 0003 ETX 4A 0112
04 0004 PF 4B 0113
05 0005 HT 4C 0114
06 0006 LC 4D 0115
07 0007 DEL 4E 0116
08 0010 undefined 4F 0117
09 0011 undefined 50 0120
OA 0012 SMM 51 0121 undefined
OB 0013 VT t h r u t h r u
OC 0014 FF 59 0131
OD 0015 CR 5A 0132
OE 0016 SO 5B 0133
OF 0017 SI 5C 0134
10 0020 DLE 5D 0135
11 0021 DC1 5E 0136
12 0022 DC2 5F 0137 —\
13 0023 TM 60 0140
14 0024 RES 61 0141
15 0025 NL 62 0142 undefined
16 0026 BS t h r u t h r u
17 0027 IL 69 0151
18 0030 CAN 6A 0152
19 0031 EM 6B 0153
1A 0032 CC 6C 0154
1B 0033 CU1 6D 0155
1C 0034 IFS 6E 0156
1D 0035 IGS 6F 0157
1E 0036 IRS 70 0160 undefined
1F 0037 IUS t h r u t h r u
20 0040 DS 78 0170
21 0041 SOS 79 0171
22 0042 FS 7A 0172
23 0043 undefined 7B 0173
24 0044 BYP 7C 0174
25 0045 LF 7D 0175
26 0046 ETB or EOB 7E 0176
27 0047 ESC or PRE 7F 0177 ••
28 0050 undefined 80 0200 undefined
29 0051 undefined 81 0201
2A 0052 SM . 82 0202
2B 0053 CU2 83 0203
2C 0054 undefined 84 0204
2D 0055 ENQ 85 0205
2E 0056 ACK 86 0206
2F 0057 BEL 87 0207
30 0060 undefined 88 0210
31 0061 undefined 89 0211
32 0062 SYN 8A 0212 undefined
33 0063 undefined t h r u t h r u
34 0064 PN 90 0220
35 0065 RS 91 0221
36 0066 UC 92 0222
37 0067 EOT 93 0223
38 0070 undefined 94 0224
39 0071 undefined 95 0225
3A 0072 undefined 96 0226
3B 0073 CU3 97 0227
3C 0074 DC4 98 0230
3D 0075 NAK 99 0231
3E 0076 undefined 9A 0232 undefined
3F 0077 SUB thru t h r u
40 0100 space AO 0240
A-12 60484800 B
TABLE A-7. FULL EBCDIC CHARACTER SET (Contd)
Jpfe..
Hexa
decimal
EBCDIC
Code
Octal
12-Bit
EBCDIC
Code
A1 0241
A2 0242
A3 0243
A4 0244
A5 0245
A6 0246
A7 0247
A8 0250
A9 0251
AA 0252
thru thru
BF 0277
CO 0300
C1 0301
C2 0302
C3 0303
C4 0304
C5 0305
C6 0306
C7 0307
C8 0310
C9 0311
CA 0312
CB 0313
CC 0314
CD 0315
CE 0316
CF 0317
DO 0320
D1 0321
D2 0322
D3 0323
D4 0324
D5 0325
D6 0326
EBCDIC
Graphic
Charactert
EBCDIC
Control
Character
undefined
undefined
undefined
undefined
undefined
Hexa
decimal
EBCDIC
Code
Octal
12-Bit
EBCDIC
Code
D7 0327
D8 0330
D9 0331
DA 0332
thru thru
DF 0337
EO 0340
E1 0341
E2 0342
E3 0343
E4 0344
E5 0345
E6 0346
E7 0347
E8 0350
E9 0351
EA 0352
EB 0353
EC 0354
ED 0355
thru thru
EF 0357
FO 0360
F1 0361
F2 0362
F3 0363
F4 0364
F5 0365
F6 0366
F7 0367
F8 0370
F9 0371
FA 0372
FB 0373
thru thru
FF 0377
EBCDIC
Graphic
Charactert
EBCDIC
Control
Character
undefined
undefined
undefined
undefined
undefined
undefined
Graphic characters shown are those used on the IBM System/370 standard (PN) print train. Other devi<
support subsets or variations of this character graphic set.
0ms
60484800 B A-13
DIAGNOSTICS
Diagnostic messages that can be issued by Sort/
Me r ge a re li s ted in ta b le B-l . I f an er r or occ urs ,
the error level and the error number are written on
the error file or the listing file. The diagnostic
message is written on the next line. For errors
numbered 1 through 40, the parameter statement that
Is in error is written on another line, and a
pointer indicates the position of the error in the
parameter statement.
An error can be one of the following levels:
T Trivial; a trivial diagnostic results from
a usage that is syntactically correct but
questionable.
W Warning; a warning diagnostic results from
a usage that is syntactically incorrect,
but from which Sort/Merge has been able to
recover by making an assumption about what
was intended.
Fatal; a fatal diagnostic results when
Sort/Merge cannot resolve a syntactic or
semantic error. The remaining parameter
statements are read, but no Sort/Merge
processing occurs.
Catastrophic; a catastrophic error causes
immediate Sort/Merge termination.
S p e c i f y i n g t h e S TAT U S p a r a m e t e r o r c a l l i n g t h e
SM5ST procedure prevents job step termination after
any data records are input; the status variable
indicates the highest level of error that occurred.
TABLE B-l. SORT/MERGE DIAGNOSTICS
J^1
0ms
Error
Number
Error
Level Message
A SPACE OR , EXPECTED
CHARACTERS USED OUTSIDE
A STRING OR NAME MUST
BE A LETTER DIGIT ) =
( ' , OR SPACE
A VALUE SHOULD FOLLOW
THIS KEYWORD
UNDEFINED COLLATING
SEQUENCE
CHARACTER AFTER KEYWORD
MUST BE SPACE OR =
INVALID KEYWORD
DETECTED
UNLESS IN A STRING, =
SHOULD FOLLOW ONLY A
KEYWORD
DUPLICATE COLLATING
SEQUENCE NAME FOUND.
Significance
A space or a comma must sep
arate parameters in a control
statement or directive file. A
space or a comma must also sep
arate values in a set of values
specified for a parameter.
Unless in a literal string or
in the name of a user—supplied
entity, only alphabetic and
numeric characters and the
special characters ) = ( ' ,
and space are valid in a con
tr o l s ta te m en t o r d ir e ct i ve
file.
At least one value must be
specified following a
parameter keyword.
The name of a key type in a KEY
parameter is not a predened
collating sequence or a se
quence you have defined with
SEQx parameters.
A parameter keyword must be
separated from its value by an
= or space.
The indicated keyword is not a
valid procedure call keyword.
Unless an - is in a literal
string, = is onl y valid i mmedi
ately following a parameter
keyword.
Collating sequence names must
be unique.
Action
Insert a space or a comma
between each parameter and
between values specified
for a parameter.
Replace invalid characters
with valid characters.
Insert a value following
the parameter keyword.
Change the name of the key
type to one of the prede
fined collating sequences
or a sequence you have
defined.
Insert an = after the
parameter keyword.
Determine valid procedure
call keywords.
Replace the invalid = with
a valid character.
Eliminate the duplicate
name.
60484800 D B-l
TABLE B-l. SORT/MERGE DIAGNOSTICS (Contd)
Error
Number
Error
Level Message Significance Action
9 F ( ) MUST ENCLOSE A
VALUE
Parentheses in a control state
ment or directive file must
enclose a parameter value.
Place a parameter value
between the parentheses*
10 CHARACTER AFTER = MUST
BE LETTER, DIGIT ( $ *
OR SPACE
Only an alphabetic or numeric
character or one of the special
characters ( $ ' or space can
follow an =.
Replace the character fol
lowing the a with a valid
character.
11 THIS VALUE SHOULD BE A
STRING (DELIMITED WITH
' S )
The indicated value must be a
literal string enclosed in
apostrophes.
Enclose the indicated value
in apostrophes.
13 THIS COMMA SHOULD BE
FOLLOWED BY A LETTER,
DIGIT, SPACE , OR (
The indicated comma must be
followed by an alphabetic or
numeric character or one of the
special characters , ( or
space.
Replace the character fol
lowing the indicated comma
with a valid character.
14 THIS CHARACTER MUST BE
A LETTER, DIGIT ( '
OR ,
The indicated character must be
an alphabetic or numeric char
acter or one of the special
characters ( * or ,.
Replace the indicated char
acter with a valid
character.
15 TOO MANY PARAMETER
POSITIONS HAVE BEEN
SPECIFIED
When specifying parameters by
position rather than by key
word, a maximum of 31 positions
is allowed; you have probably
included too many commas.
Check your control state
ment for excess commas.
17 CHARACTER AFTER ) MUST
BE SPACE ) OR ,
A right parenthesis can only be
followed by another right
parenthesis, a comma, or a
space.
Replace the invalid char
acter after the right
parenthesis with a valid
character.
18 CHARACTER AFTER ( MUST
BE A LETTER, DIGIT $ '
( OR SPACE
A left parenthesis can only be
followed by an alphabetic or
numeric character, another left
parenthesis, a $ ' or space.
Replace the invalid char
acter after the left
parenthesis with a valid
character.
19 THE HIGH AND LOW VALUES
OF THIS RANGE MUST BE
AN INTEGER, Rl, R2, R3,
RIG, EF OR EFG
If a range of values is speci
fied for the KEY, SUM, or ENR
parameter, the high and low
values of the range must be
integers or the CCL variables
Rl, R2, R3, RIG, EF, or EFG.
Replace the invalid range
value with an integer, Rl,
R2, R3, RIG, EF, or EFG.
20 THE HIGH AND LOW VALUES
OF THIS RANGE MUST BE A
STRING
If the SEQS parameter specifies
a range of values, the high and
low values of the range must be
literal strings enclosed in
apostrophes.
Replace the invalid range
with a literal string
enclosed in apostrophes.
21 CHARACTER FOLLOWING AN
INTEGER MUST BE ) .. ,
SPACE OR LETTER
Only a ) .. (indicating a
range of values), a comma, a
space, or a letter can follow
an integer.
Replace the invalid char
acter following the integer
with a valid character.
22 POSITIONAL VALUES ARE
NOT ALLOWED IN A VALUE-
SET
In a KEY or SUM parameter
value-set, key or sum field
characteristics must be speci
fied in the order shown in the
parameter formats; values
cannot be omitted and replaced
by commas.
In a KEY parameter, specify
field position, length and
type if you specify order;
specify field position and
length if you specify type.
In a SUM parameter, specify
field position, length and
type i f yo u specif y repet i
tions .
/*S3tv
B-2 60484800 D
TABLE B-l. SORT/MERGE DIAGNOSTICS (Contd)
0^S
Jp>s
Error
Number
Error
Level Message Significance Action
23 A PERIOD CANNOT BE USED
IN A PARAMETER-LIST
A period is not a valid sepa
rator in a parameter list. Replace the invalid period
with a valid separator;
refer to the parameter
syntax to determine valid
separators.
24 A RANGE IS ONLY ALLOWED
AS A VALUE FOR ENR, KEY
OR SUM PARAMETERS
A range of values can be speci
ed only for the ENR, KEY, or
SUM parameters; single values
must be specified for other
parameters.
Replace the invalid range
with a single value.
25 UNLESS $CHAR(N) IS
USED, ONLY ONE SET OF
NESTED PARENTHESES IS
ALLOWED
More than two parentheses can
appear together only when
$CHAR(n) is used in a SEQS
parameter to specify steps in a
collating sequence.
Delete the extra
parentheses.
26 UNLESS WITHIN A STRING,
NEITHER . NOR = IS
ALLOWED WITHIN A VALUE
SET
A set of values specified for a
parameter can contain a period
or an = only in a literal
string.
Correct the syntax for the
indicated values.
27 THIS VALUE SHOULD BE A
FILE OR PROC NAME
The indicated value must be the
name of a file or procedure.
Use a file or procedure
name for the indicated
value.
29 PARENTHESES MUST BE
MATCHED IN THE
PARAMETER-LIST
If a right or left parenthesis
appears in a parameter list, it
must be matched in the list by
its opposite.
Insert the missing
parenthesis.
30 TOO FEW SETS GIVEN FOR
THE KEYWORD ENDED HERE
The indicated keyword must have
a specific set of values speci
fied for it; a value or values
are missing.
Insert the values that must
be specified for the
indicated keyword.
31 TOO MANY VALUE-SETS
GIVEN FOR THIS KEYWORD-
VALUE-LIST
The indicated keyword must have
a specific set of values
specified for it; too many
values have been specified.
Determine the values that
can be specified for the
indicated keyword.
32 THIS VALUE SHOULD BE AN
INTEGER
The indicated value must be an
integer.
Replace the invalid value
with an integer value.
33 TOO MANY VALUES
SPECIFIED IN THIS
VALUE-SET
Too many values have been
specified for the indicated set
of values i n a l i s t of
parameter values.
Determine the values that
can be specified in the
indicated set of values.
34 TOO FEW VALUES
SPECIFIED IN THIS
VALUE-SET
Too few values have been speci
fied for the indicated set of
values in a list of parameter
values.
Determine the values that
can be specified in the
indicated set of values.
35 ONLY A , ) .. OR SPACE
CAN FOLLOW A PARAMETER
VALUE
Parameter values must be
followed by a , ) .. or space.
Replace the invalid
character following the
parameter value with a
v a l i d c h a r a c t e r.
37 THIS PARAMETER VALUE
MUST BE A SET OR A
RANGE
The indicated parameter value
cannot be a single value; the
value must be a set of values
or a range of values.
Replace the indicated
parameter value with a
valid set or range of
values*
60484800 D B-3
TABLE B-l. SORT/MERGE DIAGNOSTICS (Contd)
Error
Number
Error
Level Message Significance Action
50 DIALOG PARAMETER CAN
ONLY BE SPECIFIED IN A
CONTROL STATEMENT
The DIALOG parameter cannot be
in a directive file. Specify the DIALOG parame
ter in a control statement.
51 ONLY 3 VALUES CAN BE
GIVEN IN KEY/SUM VALUE-
SET IF F..L FORMAT IS
USED
Values in a KEY or SUM parame
ter value-set are separated by
commas or spaces. If you use
the first..last form to specify
key or sum eld position and
length, a maximum of two other
values (separated by commas or
spaces) is allowed.
Correct the KEY or SUM
parameter so that no more
than three values are
specified*
152 FILE, PROC, AND COL-SEQ
NAMES MUST BEGIN WITH A
LETTER
A letter (A-Z) must be the
first character in a file name,
procedure name, or the name of
a collating sequence you have
defined.
Begin each file name, pro
cedure name, and collating
sequence name with a
letter.
53 VALUES ALLOWED FOR THE
FASTIO PARAMETER ARE
YES AND NO
Valid values for the FASTIO
parameter are YES or NO, which
can be specified as Y or N.
Specify a valid value for
the FASTIO parameter.
54 MORE THAN 100 INPUT
FILES GIVEN, ONLY THE
FIRST 100 SORTED
No more than 100 files can be
sorted in any one job step;
files specified in excess of
100 are ignored.
The files in excess of 100
can be sorted in a separate
job step.
56 IF THE FIRST VALUE OF A
SEQS IS A RANGE THEN
ALL OTHER VALUES OF
THAT SEQS MUST BE
RANGES OF THE SAME
LENGTH
Single characters cannot follow
a range of characters in a SEQS
parameter.
Correct the SEQS parameter
so that it consists of
ranges of characters with
the same number of charac
ters in each range.
57 WHEN LOW*.HIGH IS USED
AS A VALUE FOR SEQS LOW
MUST BE LESS THAN HIGH
If a range of characters is
used in a SEQS parameter, the
first character in the range
must be of less value than the
last.
Correct the SEQS parameter
so that the first character
in the range is less than
the last*
58 ONLY SINGLE CHARACTER
STRINGS OR $CHAR CAN BE
USED AS VALUES FOR SEQS
Each character specified in a
SEQS parameter must be enclosed
in apostrophes and separated
from other characters by .. or
a comma; characters cannot be
grouped together. $CHAR(n)
must specify a single charac
t e r .
Correct the SEQS parameter.
1
59 FOR SCHAR(N), N MUST BE
A POSITIVE DECIMAL
INTEGER
If $CHAR(n) is used in a SEQS
parameter to specify a value
step consisting of one charac
ter, n must be a positive deci
mal integer that corresponds to
the number of the intended
character in your character
s e t .
Specify n as a positive
decimal integer.
61 FILE NAMES MUST NOT
EXCEED 7 CHARACTERS IN
LENGTH
A file name can be no longer
than 7 characters.
Change the name of the le
to a name that is 7 charac
ters or fewer in length.
/=s^\
r ^ ^ B \
B-4 60484800 D
TABLE B-l. SORT/MERGE DIAGNOSTICS (Contd)
^ms. Error
Number
62
yam^s
0^^
J^S
63
64
65
67
68
69
70
71
72
73
74
75
Error
Level Message
THE MAXIMUM LENGTH OF A
LINE IS 240 CHARACTERS
VALUES ALLOWED FOR THE
DIALOG PARAMETER ARE
YES AND NO
A SPACE OR , MUST
FOLLOW THE SORT OR
MERGE VERBS IN DIR.
FILE
A PERIOD MUST FOLLOW
SORT5 OR MERGE
DIRECTIVE FILE NAMES
MUST BE UNIQUE
LINES CONTINUING THE
SORT5 OR MERGE
PARAMETER-LIST MUST
BEGIN WITH A PERIOD
FILE NAMES CAN CONTAIN
ONLY LETTERS AND DIGITS
LENGTH MUST BE
SPECIFIED IF TYPE
SPECIFIED
IS
KEY LENGTH FOR KEYTYPE
REAL MUST BE 10
ONLY THE VALUES A OR D
ARE ALLOWED AS VALUES
FOR KEY ORDER
UNEQUAL FL FOR INPUT
AND OUTPUT FILES WITH
RT=F OR RT=Z
VALUES ALLOWED FOR THE
EL PARAMETER ARE T, W,
F OR C
VALUES ALLOWED FOR THE
LO PARAMETER ARE OFF, S
AND A
Significance
The SORT5 or MERGE control
statement and its associated
parameter list can be no longer
than 240 characters (periods
used as continuation indicators
are not counted).
Valid values for the DIALOG
parameter are YES or NO, which
can be specified as Y or N.
In a directive file, any state
ment that begins with SORT or
with MERGE must have a space or
a comma immediately following
SORT or MERGE.
In a control statement, the
word SORT5 or the word MERGE
must be immediately followed by
a period.
A directive file cannot have
the same name as any other
directive file used in the sort
or merge.
Any line of a SORT5 or a MERGE
control statement that is con
tinued beyond the first line
must begin with one period.
A file name cannot contain any
special characters.
If the key type is other than
the default ASCII6, or if
ASCII6 is explicitly specified,
key length cannot be omitted.
Keys declared to be of type
REAL must occupy a full compu
ter word and must be specified
as 10 bytes in length.
Sort order can be specified as
ascending with A or as descend
ing with D.
If you specify different fixed
length for input and output
files, Sort/Merge compresses or
expands records to fit into the
fixed length.
The only values that can be
specified for the EL parameter
are T, W, F, or C.
The only values that can be
specified for the L0 parameter
are OFF, S, or A.
Action
Parameters can be placed in
a directive file so that
the control statement is
240 characters or less.
Specify a valid value for
the DIALOG parameter.
Insert a space or a comma
immediately following SORT
or MERGE in your directive
file.
Insert a period immediately
following the word S0RT5 or
the word MERGE.
Give all directive files
different names.
Begin each continuation
line with one period.
Omit special characters
from the le name.
Specify key length.
Specify length of REAL key
as 10.
Specify either A or D for
sort order; or omit speci
fication of sort order and
ascending is assumed.
For the most efficient pro
cessing, specify the same
FL for input and output
files.
Specify T, W, F, or C as
the value of the EL
parameter.
Specify OFF, S, or A as the
value of the LO parameter.
60484800 D B-5
TABLE B-l. SORT/MERGE DIAGNOSTICS (Contd) jt^s.
Error
Number
Error
Level Message Significance Action
76 VALUES ALLOWED AS
EXPRESSIONS ARE
INTEGER, Rl, R2, R3,
RIG, EF OR EFG
The only values that can be
specified as expressions are
integers or the CCL variables
Rl, R2, R3, RIG, EF, or EFG.
Specify a valid expression.
77 SNULL SHOULD NOT BE
USED AS A VALUE WITHIN
A SET OF VALUES
SNULL is a reserved file name
signifying a null file; it must
not be specified in a list of
multiple files. $NULL can be
specified as a single value for
a parameter.
Delete $NULL from the list
of files, or specify $NULL
as the single parameter
value.
78 VALUES ALLOWED FOR THE
ST PARAMETER ARE Rl,
R2, R3, RIG, EF OR EFG
The only values that can be
specified for the STATUS param
eter are the CCL variables Rl,
R2, R3, RIG, EF, or EFG.
Specify a valid value for
the STATUS parameter.
79 VALUES ALLOWED FOR THE
RETAIN PARAMETER ARE
YES AND NO
The only values that can be
specified for the RETAIN param
eter are YES or NO, which can
be abbreviated as Y or N.
Specify a valid value for
the RETAIN parameter.
80 OWNMRL AND OWNFL SHOULD
NOT BOTH BE SPECIFIED
FOR THE SAME SORT
In a sort with owncode rou
tines, record length must be
specified with either the
OWNMRL parameter or the OWNFL
parameter.
Specify record length with
the OWNFL parameter for F
or Z type records; specify
record length with the
OWNMRL parameter for all
other record types.
81 SUM AND KEY FIELDS MAY
NOT OVERLAP
The same characters in a record
cannot be included in a sum
field and a key field.
Correct SUM parameter and/
or KEY parameter so that
the same characters are not
included in both field
descriptions.
82 LINES IN A DIRECTIVE
FILE MUST BE NO LONGER
THAN 100 CHARACTERS IN
LENGTH
A directive file statement,
beginning with SORT or MERGE,
can be 240 characters in
length, but each line in the
statement must contain no more
than 100 characters.
Use continuation lines in
your directive file so that
each line contains no more
than 100 characters.
83 REPETITION VALUE OF A
SUM FIELD MUST BE AN
INTEGER
In a SUM parameter, the number
of fields to be summed must be
expressed as an integer value.
Specify number of fields to
be summed as an integer.
84 VALUES ALLOWED FOR OWNT
PARAMETER ARE OLD AND
NEW
The only values that can be
specified for the OWNT param
eter are OLD or NEW.
Specify OLD or NEW as the
value for the OWNT param
eter.
85 IN A KEY/SUM VALUE-SET
USING FIRST..LAST,
LAST IS LESS THAN FIRST
In a KEY or SUM parameter, if
field length and position are
specified as the first and last
bytes or bits of the field then
the rst byte or bit must be
less than the last byte or bit
(the leftmost byte or bit in a
record is counted as number 1).
Correct the KEY or SUM
parameter.
86 NUMERIC KEY TYPES ARE
THE ONLY TYPES VALID
FOR SUM FIELDS
In a SUM parameter, sum field
type must be the name of a num
eric data format except REAL;
type cannot be a collating
sequence.
Correct the SUM parameter.
B-6 60484800 D
j0ms
00s,
TABLE B-l. SORT/MERGE DIAGNOSTICS (Contd)
Error
Number
87
88
89
90
91
Error
Level
92
93
94
95
Message
LINES OF A DIR FILE
MUST BEGIN WITH SORT OR
MERGE VERB, OR BE A
CONTINUATION
BYTE/BIT POSITION OR
LENGTH OF A SUM/KEY
FIELD MUST BE AN
INTEGER
SEQN VALUE MUST NOT BE
ONE OF THE PREDEFINED
KEY-TYPES
SEQR AND SEQA MAY BE
SPECIFIED ONLY ONCE FOR
EACH COLLATING SEQUENCE
SEQN MUST BE SPECIFIED
BEFORE ANY OTHER SEQ
PARAMETER CAN BE GIVEN
VALUES ALLOWED FOR SEQR
AND SEQA PARAMETERS ARE
YES AND NO
SEQN SHOULD NOT BE
GIVEN WITHOUT GIVING
SEQS OR SEQR BEFORE THE
NEXT SEQN
VALUES ALLOWED FOR SEQS
PARAMETER ARE STRINGS
AND $CHAR(N)
TWO RANGES OF
CHARACTERS USED IN THE
SAME SEQS MUST BE THE
SAME LENGTH
Significance
I n a d i r e c t i v e l e, e ac h li n e
must begin with the word SORT
or MERGE or, if the line is a
continuation line, with a char
acter of your parameter list or
one or more spaces.
In a SUM or KEY parameter,
eld length and position must
be specified as integers,
counting the leftmost byte or
bit in a record as number 1.
When you are defining your own
collating sequence with SEQx
parameters, the name of your
collating sequence cannot be
the same as the name of one of
the predefined collating
sequences.
When you are defining your own
collating sequence with SEQx
parameters, SEQR and SEQA must
not be specified more than
once.
When you are defining your own
collating sequence with SEQx
parameters, the SEQN parameter
naming your collating sequence
must be the rst SEQx
parameter.
The only values that can be
specified for the SEQR and SEQA
parameters are YES or NO, which
can be abbreviated as Y or N.
When you are defining your own
collating sequence with SEQx
parameters, you must specify
the characters in your col
lating sequence with SEQS and
SEQR parameters before naming
another collating sequence.
When you are defining your own
collating sequence with SEQx
parameters, the only valid
values for SEQS parameters are
characters enclosed in apostro
phes or $CHAR(n) where n is the
number of the character in your
character set.
When you are defining your own
collating sequence with SEQx
parameters, the ranges in any
one SEQS parameter must all be
the same length.
Action
Correct the directive file;
determine the proper format
for directive files.
Correct the SUM or KEY
parameter. (Make sure two
sets of parentheses enclose
the value-set.)
Give your collating
sequence a unique name that
is not the same as one of
the predefined collating
sequences.
Specify SEQR and SEQA only
once.
Specify SEQN before you
specify any other SEQx
parameter.
Specify a valid value for
the SEQR and SEQA param
eters.
Correct the order of the
SEQx parameters.
Correct the SEQS param
eters.
Correct the SEQS parameter
so that it specifies ranges
that are all the same
length.
60484800 D B-7
TABLE B-l. SORT/MERGE DIAGNOSTICS (Contd)
Error
Number
Error
Level Message Significance Action
96 VALUE GIVEN IN THE
$CHAR FUNCTION MUST BE
AN INTEGER
When you are defining your own
collating sequence with SEQx
parameters and are using
$CHAR(n) to specify the charac
ters in the sequence, n must be
a decimal integer corresponding
to the number of the intended
character in your character set.
Specify n of $CHAR(n) as a
decimal integer.
97 CHARACTERS GIVEN IN A
SINGLE COLLATING
SEQUENCE MUST APPEAR
ONLY ONCE
When you are defining your own
collating sequence with SEQx
parameters, a character cannot
appear more than once in all
the SEQS parameters.
Specify each character only
once in a collating
sequence.
98 COL-SEQUENCE NAMES
LONGER THAN 10
CHARACTERS ARE
TRUNCATED
You can specify a collating
sequence name of up to 31 char
acters in length, but only the
first 10 characters are sig
nificant.
None.
99 NUMBER OF KEY AND/OR
SUM CHARACTERS MUST BE
LESS THAN 256
A record cannot contain more
than 255 characters that are
defined as key or sum fields.
Specify the total number
of key and sum characters
together as 255 or less.
100 SIGNED NUMERIC CHARAC
TER FIELD IS TOO SHORT
A key field defined by a KEY
parameter or SM5KEY call as
one of the signed numeric data
formats is not long enough to
contain the data.
Redefine the key field as
long enough to contain all
the numeric characters and
the sign.
101 NO PARAMETER CAN BE
SPECIFIED MORE THAN
ONCE ON ONE LINE
Parameters that can be specified
more than once must be on separ
at e l i ne s .
Inspect parameters and
correct error(s).
102 DUPLICATE PARAMETER
SPECIFIED
Some parameters can only be
specified once.
Inspect parameters and
correct error(s).
103 EITHER AN INPUT FILE,
OWN1 OR OWN2 MUST BE
GIVEN
No sort input file given. Specify a sort input file,
or 0WN1 or 0WN2.
104 EITHER AN OUTPUT FILE,
OWN3 OR OWN4 MUST BE
GIVEN
No sort output le given. Specify a sort output file,
or OWN1 or OWN 2.
107 INCORRECT PARAMETER
VALUE
A value specified as a proce
dure call parameter is not a
valid value*
Check values that can be
specified for the procedure
call parameter.
108 TOO FEW/MANY PARAMETERS Either too few or too many
parameters have been specified
in a procedure call.
Determine parameters that
can be specified in the
procedure call*
UO CALL OUT OF SEQUENCE A call to a Sort/Merge FORTRAN
procedure is not in the proper
o r d e r.
Determine procedure call
o r d e r.
111 INVALID NAME GIVEN FOR
SM5SEQN
The name of a user-defined col
lating sequence specified with
the SM5SEQN call must begin
with a letter and consist of
letters, digits, and the
special characters ? # @ _.
Correct the name specified
with the SM5SEQN call;
enclose the name in apos
trophes.
,*"*S^.
B-8 60484800 D
TABLE B-l. SORT/MERGE DIAGNOSTICS (Contd)
r
r
r
Error Error
Number Level Message Significance Action
112 ONLY SINGLE CHARACTER Each character in a user- Specify each character in
LITERALS CAN BE USED AS defined collating sequence your collating sequence as
PARAMETERS OF SM5SEQS specified as parameters of
the SM5SEQS procedure must be
specified separately, enclosed
in apostrophes, and separated
from other characters by
commas.
a separate literal enclosed
in apostrophes.
113 RECORD LENGTH IS Record length is set by the full If subsequent errors abort
GREATER THAN MAXIMUM length (FL) or maximum record the sort, reduce the
RL - 5000 length (MRL) file information
table (FIT). Also, the OWNFL
and OWNMRL parameters or SM50FL
and SM50MRL procedures specify
the length of a record. 5000
is the maximum record length
supported; records that exceed
5000 characters may generate
subsequent errors that may
abort the sort.
number of characters per
record to 5000 or less.
114 SUM FIELDS MAY NOT Summing is handled with integer Correct the specification
EVALUATE TO MORE THAN a r i t h m e t ic . I n te ge r a n d b i n a ry of the sum eld.
60 BITS sum elds can be no more than
60 bits long.
115 RETAIN AND SUMMING MAY You cannot specify both the Remove the RETAIN or SUM
NOT BE SPECIFIED AT THE RETAIN and the SUM parameter in parameter*
SAME TIME the same sort or merge.
116 MRL/FL IS NOT LARGE The record size (MRL or FL) is Change your key or file
ENOUGH TO ACCOMMODATE not large enough to accommodate description.
THE SPECIFIED KEYS the specified keys.
117 FASTIO PARAMETER
DISABLED FOR FILES NOT
ON MASS STORAGE
The FASTIO parameter cannot
process tapes.
None necessary.
118 FASTIO PARAMETER WAS FASTIO les must have the Recheck le
SPECIFIED BUT COULD NOT same record type and length, specifications.
BE PROCESSED and must reside on mass
storage.
119 FOR KEY AND SUM FIELDS, The beginning position and Correct the key/sum
THE BEGINNING POSITION length of key and sum fields specification.
AND THE LENGTH MUST BE must be non-zero.
NON-ZERO.
120 SUMMING OVERFLOW Sum elds in t h e o u t put l e Check data and summing
OCCURRED - SEE DAYFILE have invalid data. s p e c i fi c a t i o n s .
FOR DETAILS.
121 UNABLE TO LOAD USER
OWNCODE - SORT DID
NOT COMPLETE.
A fat al l oader error occurre d. Check your owncode les.
122 OWNCODE WAS SPECIFIED
BUT NO OWNF FILE WAS
GIVEN.
OWNF parameter was omitted. Specify the OWNF parameter.
151 NOT SORT, MERGE OR In the SMFILE call, le dis None, or change SMFILE
OUTPUT; 'SORT' ASSUMED position must be indicated as
SORT, MERGE, or OUTPUT.
call to indicate MERGE or
OUTPUT.
60484800 D B-9
TABLE B-l. SORT/MERGE DIAGNOSTICS (Contd)
Error
Niraber
Error
Level Message Significance Action
152 RETURNED FROM OWNCODE
WITHOUT CALLING SMRTN
Control has returned to Sort/
Merge from an owncode routine
without using a call to SMRTN;
processing terminates.
Determine the proper method
of calling SMRTN.
153 TOO MANY ERRORS FOUND.
PROCESSING TERMINATED.
The maximum number of errors
for one call to Sort/Merge have
occurred; processing terminates.
Correct errors and resubmit
job.
154 SMRTN CALL ILLEGAL WITH
SM5 PROCEDURES - RUN
ABORTED.
The Sort/Merge 4 compatible
routine SMRTN has been called
by a set of owncode procedures
using SM5xxx calls.
Change SMRTN to RETURN or
the equivalent.
155 RETURN CODE MUST BE IN
RANGE 0-3
The return code from all own-
code routines must be 0, 1, 2,
or 3.
Change the value of the
return code.
156 AN INPUT RECORD WAS
READ WHICH WAS TOO
SHORT TO HOLD THE
KEY/SUM FIELDS
SPECIFIED FOR THIS
SORT/MERGE.
The order of the records is
undefined if the key fields
are not within the record.
Change your key
description
157 NEITHER SORT NOR MERGE
HAS BEEN SPECIFIED
You have omitted a call to
SM5SORT or SM5MERGE.
Call SM5SORT or
SM5MERGE before any
other SMS procedures.
158 FILE NAMES FOR A MERGE
MUST BE UNIQUE.
Duplicate file names exist for
TO/FROM parameters.
Eliminate the duplicate
file names.
159 KEY FIELDS OVERLAP
OTHER KEY FIELDS.
The same characters in a record
are included in two or more key
fields.
None.
160 ALTER OPTION CANNOT
BE USED FOR OVERLAPPING
KEY FIELDS.
When you define your own col
lating sequence use the SEQA
parameter or the SM5SEQA proc
edure, you cannot have over
lapping key fields.
Redefine the key fields
so they do not overtop.
161 SUM FIELDS CANNOT OVER
LAP OTHER SUM FIELDS
The same characters in a record
cannot be included in more than
one sum eld.
Redefine the sum fields
so that they do not
overlap.
B-10 60484800 D
GLOSSARY
0ms
Th is glossary denes terms unique to the des crip
tion of Sort/Merge; common terms that have special
connotations within the context of this manual are
also included.
Ascending -
The order of sorting keys so that the record
having the numeric key with the highest value
is written last on the output file, and charac
ter k eys a r e so r t ed a c c ording to t h e sp e c ied
collating sequence. See Sort Order.
ASCII -
American National Standard Code for Information
Interchange. An 8-bit code representing a
pre scribed set of 12 8 cha racters. Contr ol Da t a
operating systems use a 6-bit display code to
represent a subset (called ASCII6) of these
characters.
Basic Access Methods (BAM) -
A file manager that processes sequential and
word addressable file organizations. See CYBER
Record Manager.
Beginning-of-information (BOI) -
The start of your first record in a file.
System information, such as tape labels of
sequential files, can appear before beginning-
o f-informa 11on.
Block -
A logical or physical grouping of records.
CYBER Record Manager defines block types I, C,
K, and E for sequential files.
Byte -
A group of bits. In the body of this manual, a
byte is six bits that represents a single
character.
Character -
A letter, digit, punctuation mark, or mathe
matical symbol forming part of one or more of
the standard character sets.
Collating Sequence -
A sequence in which the characters that are
acceptable to a computer are ordered for
purposes of sorting, merging, and comparing.
Control Statement Section -
The first section of a job; contains the
sequence of control statements that specifies
all steps for job execution.
Control Statement Sort -
A sort performed on the basis of parameters in
the S0RT5 control statement and in optional
d i r e c t i v e l e s .
CYBER Control Language (CCL) -
A language that allows you to insert a set of
statements into the control statement section
of your job; provides a means for you to
determine the status of files, initiate tests
and transfers within the control statement
section, and display results in your job
dayfile.
CYBER Record Manager (CRM) -
A generic term relating to the common products
Advanced Access Methods and Basic Access
Methods that run under the NOS and NOS/BE
operating systems and that allow a variety of
record types, blocking types, and file
organizations to be created and processed. The
execution time input/output of COBOL, FORTRAN,
Sort/ Merge, ALGOL, and the DMS-170 products is
implemented through CYBER Record Manager. The
input/output of the NOS and NOS/BE operating
system utilities such as COPY or SKIPF are not
implemented through CYBER Record Manager. All
CYBER Record Manager file processing requests
ultimately pass through the operating system
input/output routines.
Default -
A value supplied by Sort/Merge when you omit a
spe c ic a tio n fr o m a pa r ame t er l ist .
Descending -
The order of sorting keys so that the record
having the numeric key with the lowest value is
written last on the output file, and character
keys are sorted in reverse order of the speci
fied collating sequence. See Sort Order.
Dialog -
An interactive aid designed to guide an in
experienced user through a sort or merge
specification.
Directive File -
A file that can be used in a control statement
sort or merge; contains processing parameters
in a d di ti o n to th e p ar a m e te rs sp ec i e d i n t h e
S 0 RT 5 o r M E R G E co n t r o l s t at e me n t. Th i s l e
must be a sequential file of block type C and
record type Z.
Display Code -
A 6-bit code representing a 63-character or
64-character computer character set.
EBCDIC -
The abbreviation for extended binary-coded
decimal interchange code. Control Data oper
a t i n g s y s t e m s u s e a 6 - b i t v e r s i o n ( c a l l e d
EBCDIC6) to represent this code.
End-of-information (EOI) -
CYBER Record Manager defines end-of-informat Ion
Ln sequential files In terms of the file resi
dence, as shown in table C-l.
Entry Point -
A locati o n with i n a program that can b e refer
enced from other programs. Each entry point
ha8 a unique name with which it is associated.
60484800 B C-l
TABLE C-l. END-OF-INFORMATION BOUNDARIES
File
Organization
File
Residence Physical
Position
Sequential
Sequential
Sequential
Sequential
Mass storage
Labeled tape
in S I , I, S,
or L format
Unlabeled
tape in SI
or I format
Unlabeled
tape in S or
L format
After the last
user record*
After the last
user record and
before any file
trailer labels.
After the last
user record and
before any file
trailer labels.
Undefined.
F i l e -
A collection of records treated as a unit;
represented by a logical file name and delim
ited by beginning-of-information and end-of-
information.
FILE Control Statement -
A control statement that supplies file informa
tion table (FIT) values after a source language
program is compiled or assembled but before the
program is executed. Basic file characteris
tics such as organization, record type, and
d e s c r i p t i o n c a n b e s p e c i fi e d i n t h e F I L E
control statement.
File Information Table (FIT) -
A table through which your program communicates
wit h B A M . Al l l e pr o ces s ing ex e cute s o n th e
basis of information in the FIT. You can set
FIT fields directly or use parameters in a file
ac c es s c a ll th a t s et s t h e el d s i nd ir e ct l y.
Floating-Point Number -
N u m e r i c d a t a s t o r e d i n t e r n a l l y a s b i n a r y
values (corresponds to a FORTRAN REAL or COBOL
COMPUTATIONAL-2 number).
Graphic -
A character that can be printed or displayed.
Integer -
Numeric data stored internally as a binary
value rather than a character value; in a
parameter or procedure call format, a number
that does not include any character positions
to the right of the assumed decimal point and
is not signed.
I n t e r a c t i v e -
Job processing in which you and the system
communciate with each other, rather than your
submitting a job and receiving output, having
no control over the job while processing occurs.
Interactive Facility (IAF) -
The network host software product that allows
you to enter commands and to communicate with
a n e x e c u t i n g p r o g r a m f r o m a t i m e - s h a r i n g
terminal; operates under NOS.
INTERCOM -
The software that directs the flow of informa
tion and data between the central site computer
and a number of remote terminals; operates
under NOS/BE.
Job -
A set of control statements and the data and
directives used by those control statements. A
batch job begins with the job, USER, and CHARGE
statements on NOS and the job and ACCOUNT
statements on NOS/BE. An interactive job
begins with login to a terminal.
Key Type -
The name of a numeric data format or collating
sequence.
Keyword -
A part of a parameter that you enter exactly as
shown in the parameter format. It is not
changed by any information you supply.
Library -
A collection of programs or routines that is
searched by the loader for entry points refer
enced by a program.
Literal -
A constant completely defined by its own
identity.
Local File -
A file currently assigned to a job, or a
temporary file other than the primary file;
often contains a copy of an indirect access
le or data from a magnetic tape.
Logical File Name (lfn) -
The one to seven coded letters or digits by
which the operating system recognizes a file.
Every logical file name in a job must be unique
and begin with a letter.
Logical Record -
Under NOS, a data grouping that consists of one
or more PRUs terminated by a short PRU or
z e r o - l e n g t h P R U . E q u i v a l e n t t o a s y s t e m -
logical-record under NOS/BE.
Login -
The process used at a terminal to gain access
to the system.
Logout -
The process used to end a terminal session.
Major Sort Key -
A s o rt key th a t i s c ons i de r ed to be t he mo s t
important and is specified first. See Sort
Key, Minor Sort Key.
Mass Storage -
A disk pack or other rotating mass storage
device; not a magnetic tape.
r^^S
,A*ms
C-2 60484800 B
0^S Merge -
The process of combining two or more presorted
files.
Minor Sort Key -
A sort key that is considered of lesser impor
tance and is specified after the most important
sort key. See Sort Key, Major Sort Key.
Owncode Routine -
A subroutine you write that provides the capa
bility of inserting, substituting, modifying,
or deleting input and output records during
Sort/Merge processing.
Parameter -
A variable identified by a keyword and assigned
specific values in the S0RT5 or MERGE control
statement or in a directive file; parameters
and their specified values direct Sort/Merge
processing.
Partition -
CYBER Record Manager defines a partition as a
division within a file with sequential orga
nization. Generally, a partition contains
several records or sections. Implementation
o f a p a r t i t i o n b o u n d a r y i s a f f e c t e d b y l e
structure and residence, as shown in table C-2.
N o t i c e t h a t i n a l e w i t h W t y p e r e c o r d s , a
short physical record unit (PRU) of level 0
terminates both a section and a partition.
Physical Record Unit (PRU) -
Under NOS and NOS/BE, the amount of information
transmitted by a single physical operation of a
specified device. The size of a PRU depends on
the device, as shown in table C-3.
A PRU that is not full of user data is called a
short PRU; a PRU that has a level terminator
but no user data is called a zero-length PRU.
Procedure -
A subroutine that returns values through its
parameters; invoked when the name of the
procedure is referenced in a CALL or ENTER
statement.
Record -
CYBE R Record Manager denes a rec o r d as a
group of related characters. A record or a
portion thereof is the smallest collection of
information that can be passed between CRM and
your program. Eight different record types
exist, as defined by the RT field of the file
information table.
Record Type -
The term record type can have one of several
m e a n i n g s , d e p e n d i n g o n t h e c o n t e x t . C Y B E R
Record Manager defines eight record types
established by an RT field in the file infor
mation table. Tables output by the loader
are classified as record types such as text,
relocatable, or absolute, depending on the
first few word8 of the tables.
Relocatable -
An object program that can reside in any part
of central memory. The actual starting address
is established at load time.
TABLE C-2. PARTITION BOUNDARIES
Device
PRU
device
Record
Type
(RT)
Block
Type
(BT)
S or L
format
tape
D, F,R ,
T,U,Z
•Any
other
tape
format
D , F, T,
R,U,Z
Physical Boundary
A short PRU of
level 0 containing
a one-word deleted
record pointing
back to the last I
block boundary,
followed by a con
trol word with a
flag indicating a
partition boundary.
A short PRU of
level 0 containing
a control word
w i t h a a g i n d i
cating a partition
boundary.
A short PRU of
level 0 followed by
a zero-length PRU
of level 17g.
A zero-length PRU
of level number 17g.
C,K,E
A separate tape
block containing as
many deleted rec
ords of record
length 0 as re
quired to exceed
noise record size,
followed by a de
leted one-word
record pointing
back to the last I
block boundary,
followed by a con
trol word with a
flag indicating a
partition boundary.
A separate tape
block containing as
many deleted rec
ords of record
length 0 as re
quired to exceed
noise record size,
followed by a con
trol word with a
flag indicating a
partition boundary.
A tapemark.
A tapemark.
Undefined.
y$mt.
60484800 B C-3
TABLE C-3. PRU SIZES TABLE C-4. SECTION BOUNDARIES
Device Size in Number
of 60-Bit Words
Mass storage.
Tape in SI format with
binary data (NOS/BE only).
Tape in I format (NOS only).
Tape in any other format.
64
512
512
Undefined.
Result Array -
A means of passing statistics and results of a
sort or merge back to a calling procedure.
Rewind -
An operation that positions a file at the
beginning-of-information.
Section -
CYBER Record Manager defines a section as a
d i v i s i o n w i t h i n a l e w i t h s e q u e n t i a l o r g a
nization. Generally, a section contains more
than one record and is a division within a
partition of a file. A section terminates
w i t h a p h y s i c a l r e p r e s e n t a t i o n o f a s e c t i o n
boundary, as shown in table C-4.
The NOS and NOS/BE operating systems equate a
section with a system-logical-record of level 0
through 16g.
Sequential File -
A file with records in the physical order in
which, they were written. No logical order
exists other than the relative physical record
position.
Signed Numeric Data -
Integer data stored internally in display code;
sorted according to numeric order and sign of
the integer the display code represents.
Sort Key -
A field of information within each record in a
sort or merge input file that is used to deter
mine the order in which records a re writt en to
t h e o u t p u t l e .
Sort Order -
The order for sorting keys, either ascending or
descending.
System-Logical-Record -
Under NOS/BE, a data grouping that consists
of one or more PRUs terminated by a short PRU
or zero-length PRU. These records can be
transferred between devices without loss of
structure. Equivalent to a logical record
under NOS.
Word -
A g r o u p o f b i ts ( o r 6 - b i t ch a r a c t er s) b e t we e n
boundaries imposed by the computer system. A
word is 60 bits in length (10 characters).
Device
Record
Type
(RT)
Block
Type
(BT)
Physical
Representation
PRU A deleted one-word
device record pointing
back to the last I
block boundary
followed by a con
tro l wor d with
flags indicating a
section boundary.
At least the con
trol w o r d is i n
a short PRU of
l e v e l 0 .
WCA control word with
flags indicating a
section boundary.
The control word
is in a short PRU
of level 0.
D,F,R, A short PRU with a
T,U,Z leve l less than
"8.
S-Undefined.
S or L A separate tape
format block containing
tape as many deleted
records of record
length 0 as re
quired to exceed
noise record size,
followed by a de
leted one-word
record pointing
back to the last I
block boundary,
followed by a con
tro l wor d with
flags indicating a
section boundary.
W C A separate tape
block containing
as many deleted
records of record
length 0 as re
quired to exceed
noise record size,
followed by a con
trol word with
flags indicating a
section boundary.
D,F,R, C,K,E Undefined.
T, U , Z
SUndefined.
Any Undefined.
other
tape
format
C-4 60484800 B
0&S.
SORT/MERGE PARAMETER SUMMARY
r
The format specifications for all parameters used
in a S0RT5 or a MERGE control statement are sum
marized and listed in this appendix. Detailed
information for each parameter is referenced by
page number and appears in section 3 of this manual.
The following abbreviations are used in this
appendix:
char character
expr expression
lfn logical file name
proc procedure name
rep repetition
DIALOG Parameter
DIALOG=YES (or DIA=Y)
DIALOG=NO (or DIA=N)
Page
3-4
FROM Parameter
FROM=lfn
F R O M = ( l f n 1 , l f n 2 , . . . )
FROM=$NULL
KEY Parameter
KEY= j(key_def[,key_def]
L range
where:
..,-,
Page
3-2
3-2
[range "j
( r a n g e t , t y p e [ , a d ] ] )
( r s t , l e n g t h [ , t y p e [ , a d ] ] ) J
range = ["first "J
|_first..lastj
rDIR Parameter
DIR=lfn
DIR»(lfnlflfn2i...)
3-3 L Parameter
L = l f n
L=$NULL
3-3
E Parameter
E=lfn
E=$NULL
EL Parameter
EL=T
EL=W
EL=F
EL=C
ENR Parameter
ENR=expr
ENR=expr .. expr
3-4
3-4
3-4
OWNF Parameter
OWNF=lfn
OWNFL Parameter
OWNFL=integer
0FL=integer
OWNMRL Parameter
OWNMRL=integer
OMRL=integer
OWNn Parameter
OWNn=proc
3-4
3-5
3-5
3-5
FASTIO Parameter
FASTIO=YES (or FASTIO=Y)
FASTIO=NO (or FASTIO=N)
3-9 RETAIN Parameter
RETAIN=YES (or RET=Y)
RETAIN=NO (or RET=N)
3-5
60484800 C D-l
SEQx Parameters
SEQN=name
SEQS=('char',...,'char')
Page
3-5
Page
where:
sum_def = T(rst,length,type[ ,rep] )"]
L(first..last,type[,rep]) J
[SEQR=YES OR SEQR-Y]
' [SEQA=YES OR SEQA=Y]
STATUS Parameter
STATUS=variable (or ST=variable)
SUM Parameter
SUM=((sum_def)[,(sum_def)]...)
3-7
3-8
TO Paraaeter
TO=lfn
TO=$NULL
VERIFY Parameter
VERIFY=YES (or VER=Y)
VERIFY=NO (or VER=N)
3-2
3-9
^S%s
^^
A^^S
D-2 60484800 C
0^S
r
INTERACTIVE DIALOG
This appendix contains the text of the interactive
dialog (figure E-l) that is invoked when you spec
ify DIALOGUES. (Your terminal must be in normal
mode; enter NORMAL before entering the S0RT5 or
MERGE command. If you are already in the dialogue,
e n t e r a c o n t r o l - T t o r e t u r n t o t h e o p e r a t i n g
system). The questions asked by Sort/Merge are
indicated by uppercase letters. The answers you
s u p p l y a r e i n d i c a t e d b y l o w er c a s e l e t t e r s ; " n e x t "
or a number following an answer indicates the next
question that is asked by Sort/Merge. For
questions requiring yes or no answers, you can
abbreviate and use y or n.
IS YOUR TERMINAL ALREADY SET TO NORMAL MODE OR UPPERCASE ASCII MODE. ALSO, ARE YOU SURE THAT ALL YOUR
FILES (IF ANY) ARE EITHER STANDARD UNIT RECORD FORMAT OR HAVE HAD FILE CONTROL STATEMENTS SPECIFIED FOR
THEM
yes (1)
no (next)
UNLESS YOU SPECIFY OTHERWISE, ALL INPUT FILES AND THE OUTPUT FILE ARE ASSUMED TO HAVE STANDARD UNIT
RECORD FORMAT SUCH AS LINES TYPED FROM A TERMINAL, LINES IN A BATCH JOB, OR LINES TO BE PRINTED ON A
PRINTER OR TERMINAL. THESE ARE TECHNICALLY KNOWN AS BT=C, RT=Z, FL=N WITH N NO MORE THAN 150. DO YOU
HAVE ANY FILES THAT ARE NOT OF THIS FORMAT?
yes (next)
n o ( 1 )
FOR EACH FILE THAT IS NOT OF THIS FORMAT YOU MUST HAVE SPECIFIED A FILE CONTROL STATEMENT. SORT/MERGE
WILL QUIT NOW SO YOU MAY DO SO.
1. DO YOU HAVE JUST ONE INPUT FILE AND NO 0WN1 OR 0WN2 SUBROUTINES?
yes (next)
n o ( 6 )
2. WHAT IS THE NAME OF YOUR INPUT FILE?
file-name
3. DO YOU HAVE ANY OWN3 OR 0WN4 SUBROUTINES?
yes (9)
no (next)
4. WHAT IS THE NAME OF YOUR OUTPUT FILE?
file-name
5. THE STANDARD COLLATING SEQUENCE IS ASCII6. HERE IS THE WHOLE ASCII6 COLLATING SEQUENCE LISTED
."#$%&' ()*+,-./0123456789:;<=>?aABCDEFGHIJKLMN0PQRSTUVWXYZC\D^_
DO ALL OF YOUR KEYS CONSIST OF CHARACTER DATA TO BE SORTED ACCORDING TO THE ASCII6 COLLATING
SEQUENCE?
yes (next)
no (12)
ASCENDING ORDER OF THE ASCII6 COLLATING SEQUENCE MEANS THE NORMAL ORDER.
!"0$X&' ()*+,-./0123456789:;<=>?SABCDEFGHIJKLMN0PQRSTUVWXYZC\D^_
DESCENDING ORDER MEANS THE REVERSE ORDER.
_^J\CZYXWVUTSRQP0NMLKJIHGFEDCBAa?>=<;:9876543210/.-,+*)('8%$#,,l
DO YOU WANT ALL YOUR KEYS SORTED IN ASCENDING ORDER?
yes (next)
no (next)
33. HOW MANY KEY FIELDS DO YOU HAVE?
number
WHAT IS THE TYPE OF THE MOST IMPORTANT KEY FIELD?
key-type
THE LEFT-MOST CHARACTER OF A RECORD IS NUMBER 1. FOR THE MOST IMPORTANT KEY FIELD, WHAT IS THE
NUMBER OF THE LEFT-MOST CHARACTER?
number
HOW MANY CHARACTERS ARE IN THE MOST IMPORTANT KEY FIELD?
number
Figure E-1. Interactive Dialog (Sheet 1 of 5)
60484800 D E-l
DO YOU WANT THIS KEY FIELD SORTED IN ASCENDING ORDER?1
yes
no
yes (next)
(next)
FOR THE SECONDttnOST IMPORTANT KEY FIELD, WHAT IS THE TYPE OF THE KEY?
key-type
FOR THE SECOND"^MOST IMPORTANT KEY FIELD, WHAT IS THE NUMBER OF THE LEFT-MOST CHARACTER?
number
HOW MANY CHARACTERS ARE IN THE SECOND+tHOST IMPORTANT KEY FIELD?
number
DO YOU WANT RECORDS WITH EQUIVALENT KEY VALUES TO BE WRITTEN IN THE SAME ORDER THEY ARE READ?
yes (next)
no (next)
A SUM FIELD IS A SPECIAL FIELD IN A RECORD THAT IS CHANGED BY SORT/MERGE. IF SUM FIELDS ARE
SPECIFIED SUM FIELDS FROM RECORDS WITH EQUAL KEY VALUES WILL BE NUMERICALLY SUMMED AND PUT IN THE
SANE SUM FIELD IN A NEW RECORD. THE REMAINING KEY AND DATA FIELDS IN THE NEW RECORD WILL BE SET TO
THE CORRESPONDING FIELDS IN ONE OF THE OLD RECORDS. THE ORIGINAL RECORDS WILL BE DELETED. RECORDS
MAY HAVE MORE THAN ONE SUM FIELD, AND THEY WILL BE SORTED ACCORDING TO KEY VALUES. THEY TYPE OF A
SUM MAY BE ANY NUMERIC KEY TYPE EXCEPT REAL.
28. HOW MANY SUM FIELDS DO YOU HAVE?
number
WHAT IS THE TYPE OF THE FIRST^SUM FIELD?
sura-type
WHAT IS THE FIRST CHARACTER IN THE FIRSfftsUM FIELD?
number
it •tt«
HOW MANY CHARACTERS* LONG IS THE FIRST" SUM FIELD?
number
GIVE AN ESTIMATE OF THE MAXIMUM NUMBER OF RECORDS TO BE SORTED,
number (end of dialog)
6. DO YOU HAVE AN OWN1 SUBROUTINE?
yes (next)
n o ( 7 )
WHAT IS THE NAME OF THE FILE CONTAINING YOUR OWNCODE SUBROUTINE(S)?
f1le-name
WHAT IS THE NAME OF YOUR OWN1 SUBROUTINE?
entry-name
7. DO YOU HAVE AN OWN2 SUBROUTINE?
yes (next)
n o ( 8 )
WHAT IS THE NAME OF THE FILE CONTAINING YOUR OWNCODE SUBROUTINE(S)?^
le-name
8. HOW MANY INPUT FILES DO YOU HAVE?
1 ( 2 )
number (next)
WHAT IS THE NAME OF YOUR FIRST^t INPUT FILE?
file-name
9. WHAT IS THE NAME OF THE FILE CONTAINING YOUR OWNCODE SUBROUTINE(S)?**
file-name
DO YOU HAVE AN OWN3 SUBROUTINE?
yes (next)
no (10)
Figure E-1. Interactive Dialog (Sheet 2 of 5)
E-2 60484800 A
yffi^s
r
WHAT IS THE NAME OF YOUR 0WN3 SUBROUTINE?
entry-name
DO YOU HAVE AN 0WN4 SUBROUTINE?
yes (next)
n o ( 1 1 )
10. WHAT IS THE NAME OF YOUR 0WN4 SUBROUTINE?
entry-name
11. DO YOU HAVE AN OUTPUT FILE?
yes (4)
n o ( 5 )
12. DO YOU KNOW THE NAMES OF THE KEY TYPES YOU WANT TO USE?
yes (33)
no (next)
DO YOUR RECORDS CONSIST ENTIRELY OF CHARACTERS?
yes (19)
no (next)
NON-CHARACTER DATA MAY BE ORDERED ACCORDING TO ITS BINARY (SIGNED OR UNSIGNED) VALUE, OR REAL (I.E.
FLOATING POINT) VALUE.
A SIGNED BINARY KEY INTERPRETS THE BITS WITHIN THE KEY FIELD AS A ONE'S COMPLEMENT BINARY NUMBER.
IF THE LEFT-MOST BIT IS ZERO THEN THE NUMBER IS POSITIVE. IF THE LEFT-MOST BIT IS ONE THEN THE
NUMBER IS NEGATIVE AND THE MAGNITUDE OF THE NUMBER IS THAT WITH ALL BITS COMPLEMENTED. IF THE KEY
FIELD STARTS AND ENDS ON A CHARACTER BOUNDARY THEN THE KEY TYPE IS "INTEGER", OTHERWISE IT IS
"INTEGER_BITS".
AN UNSIGNED BINARY KEY INTERPRETS THE BITS WITHIN THE KEY FIELD AS A BINARY NUMBER. THE LEFT-MOST
BIT IN THE FIELD CONTRIBUTES TO THE NUMERIC VALUE JUST LIKE ANY OTHER BIT IN THE FIELD. IF THE KEY
FIELD STARTS AND ENDS ON A CHARACTER BOUNDARY THEN THE KEY TYPE IS "BINARY", OTHERWISE IT IS
"BINARY_BITS".
A REAL OR FLOATING POINT KEY INTERPRETS A 60-BIT VALUE AS A STANDARD FLOATING POINT NUMBER. THE KEY
TYPE IS "REAL".
13. IF YOU WANT MORE INFORMATION ABOUT A KEY TYPE, INCLUDING HOW TO SPECIFY IT, TYPE THE NAME OF THE KEY
TYPE. (OTHERWISE, TYPE A SPACE.)
binary (14)
binary_bits (15)
integer (16)
integer_bits (17)
real (18)
A ( 1 9 )
14. A BINARY KEY FIELD IS SPECIFIED BY NAMING THE FIRST CHARACTER POSITION AND THE LENGTH OF THE FIELD.
(THE FIRST CHARACTER POSITION IN THE RECORD IS 1.)
(13)
15. A BINARY BITS KEY FIELD IS SPECIFIED BY NAMING THE FIRST BIT POSITION AND THE LENGTH OF THE FIELD.
(THE FIRST BIT POSITION IN THE RECORD IS 1.)
(13)
16. AN INTEGER KEY FIELD IS SPECIFIED BY NAMING THE FIRST CHARACTER POSITION AND THE LENGTH OF THE
FIELD. (THE FIRST CHARACTER POSITION IN THE RECORD IS 1.)
(13)
17. AN INTEGERJ3ITS KEY FIELD IS SPECIFIED BY NAMING THE FIRST BIT POSITION AND THE BIT LENGTH OF THE
FIELD. (THE FIRST BIT POSITION IN THE RECORD IS 1.)
(13)
18. A REAL KEY FIELD IS SPECIFIED BY NAMING THE FIRST CHARACTER POSITION AND THE CHARACTER LENGTH OF THE
FIELD. SINCE REAL KEY FIELDS MUST BE FULL WORDS AND ALIGNED ON WORD BOUNDARIES, THE FIRST CHARACTER
POSITION MUST SPECIFY THE FIRST CHARACTER OF A WORD AND THE LENGTH MUST BE 10.
(13)
Figure E-1. Interactive Dialog (Sheet 3 of 5)
60484800 A E-3
19. KEY FIELDS CONSISTING ONLY OF CHARACTERS MAY BE ORDERED ACCORDING TO A CHARACTER COLLATING SEQUENCE
OR ACCORDING TO A NUMERIC INTERPRETATION OF THE CHARACTERS.
DO YOU WANT ANY OF YOUR CHARACTER KEY FIELDS TO BE INTERPRETED NUMERICALLY?
yes (next)
no (27)
THE KEY TYPE FOR NUMERIC CHARACTER KEYS IS "NUMERICJCX" WHERE XX INDICATES HOW THE SIGN (IF ANY) IS
TO BE EXTRACTED AND WHETHER LEADING BLANKS ARE ALLOWED. THE LEGAL NUMERIC CHARACTER KEY TYPES ARE:
NUMERICJJS ALL DIGITS, NO SIGN
NUMERIC_FS LEADING BLANKS, THEN OPTIONAL NEGATIVE SIGN, THEN DIGITS
NUMERICJ.S REQUIRED SIGN IS FIRST, THEN DIGITS
NUMERIC_TS DIGITS FOLLOWED BY REQUIRED SIGN
NUMERICJ.0 LEADING OVERPUNCHED DIGIT, THEN DIGITS
NUMERIC_TO DIGITS FOLLOWED BY TRAILING OVERPUNCHED DIGIT
20. IF YOU WANT MORE INFORMATION ABOUT ONE OF THE NUMERIC CHARACTER KEY TYPES, INCLUDING HOW TO SPECIFY
IT, TYPE THE NAME OF THE KEY TYPE. (OTHERWISE, TYPE A SPACE.)
nuraericjns (21)
numeric_fs (22)
numeric_ls (23)
nuraeric_ts (24)
numeric__lo (25)
numeric_to (26)
A ( 2 7 )
21. NUMERICJIS KEY FIELDS MUST CONTAIN ALL DECIMAL DIGIT CHARACTERS WITHOUT A SIGN. THE FIELD IS
SPECIFIED BY NAMING THE FIRST CHARACTER POSITION AND THE CHARACTER LENGTH OF THE FIELD.
(20)
22. NUMERIC_FS KEY FIELDS MUST BE NUMERIC CHARACTERS IN A FLOATING SIGN FORMAT. LEADING BLANKS ARE
REQUIRED FOR LEADING ZEROS, FOLLOWED BY AN OPTIONAL SIGN CONSISTING OF "-", FOLLOWED BY DECIMAL
DIGIT CHARACTERS. THIS IS THE SAME FORMAT AS IS PRODUCED BY WRITING ACCORDING TO THE DEFAULT
FORTRAN I FORMAT WITH NO MODIFIERS. THE FIELD IS SPECIFIED BY NAMING THE FIRST CHARACTER POSITION
AND THE CHARACTER LENGTH OF THE FIELD.
(20)
23. THE FIRST CHARACTER OF A NUMERICJ.S KEY FIELD MUST BE A "+" OR "-" CHARACTER. THE REMAINING
POSITIONS MUST CONSIST OF DECIMAL DIGIT CHARACTERS. THE FIELD IS SPECIFIED BY NAMING THE FIRST
CHARACTER POSITION AND THE CHARACTER LENGTH OF THE FIELD.
(20)
24. THE TRAILING (RIGHT-MOST) CHARACTER OF A NUMERIC_TS KEY FIELD MUST BE A "+" OR "-" CHARACTER. THE
REMAINING POSITIONS MUST CONSIST OF DECIMAL DIGIT CHARACTERS. THE FIELD IS SPECIFIED BY NAMING THE
FIRST CHARACTER POSITION AND THE CHARACTER LENGTH OF THE FIELD.
(20)
25. THE LEADING (LEFT-MOST) CHARACTER OF A NUMERICJ.0 KEY FIELD MUST BE AN OVERPUNCHED DIGIT. THE
OVERPUNCHED DIGIT DETERMINES BOTH THE SIGN OF THE ENTIRE NUMBER AND THE VALUE OF THE LEADING DIGIT.
CHARACTERS FROM "0" TO "9" MEAN THE SIGN IS POSITIVE AND THE LEADING DIGIT IS 0 TO 9. CHARACTERS
FROM "A" TO "I" MEAN THE SIGN IS POSITIVE AND THE LEADING DIGIT IS 1 to 9. CHARACTERS FROM "J" TO
"R" MEAN THE SIGN IS NEGATIVE AND THE LEADING DIGIT IS 1 TO 9. THE CHARACTER "<" MEANS THE SIGN IS
POSITIVE AND THE LEADING DIGIT IS 0. THE CHARACTER "!" MEANS THE SIGN IS NEGATIVE AND THE LEADING
DIGIT IS ZERO. THE REMAINING POSITIONS OF THE FIELD MUST CONTAIN DECIMAL DIGITS. THE FIELD IS
SPECIFIED BY NAMING THE FIRST CHARACTER POSITION AND THE CHARACTER LENGTH OF THE FIELD.
(20)
26. THE TRAILING (RIGHT-MOST) CHARACTER OF A NUMERIC_TO KEY FIELD MUST BE AN OVERPUNCHED DIGIT. THE
OVERPUNCHED DIGIT DETERMINES BOTH THE SIGN OF THE ENTIRE NUMBER AND THE VALUE OF THE TRAILING
DIGIT. CHARACTERS FROM "0" TO "9" MEAN THE SIGN IS POSITIVE AND THE TRAILING DIGIT IS 0 TO 9.
CHARACTERS FROM "A" TO "I" MEAN THE SIGN IS POSITIVE AND THE TRAILING DIGIT IS 1 TO 9. CHARACTERS
FROM "J" TO "R" MEAN THE SIGN IS NEGATIVE AND THE TRAILING DIGIT IS 1 TO 9. THE CHARACTER "<" MEANS
THE SIGN IS POSITIVE AND THE LEADING DIGIT IS 0. THE CHARACTER "!" MEANS THE SIGN IS NEGATIVE AND
THE TRAILING DIGIT IS ZERO. THE REMAINING POSITIONS OF THE FIELD MUST CONTAIN DECIMAL DIGITS. THE
FIELD IS SPECIFIED BY NAMING THE FIRST CHARACTER POSITION AND THE CHARACTER LENGTH OF THE FIELD.
(20)
Figure E-1. Interactive Dialog (Sheet 4 of 5)
E-4 60484800 A
27. DO YOU WANT ANY OF YOUR CHARACTER KEYS TO BE ORDERED ACCORDING TO A COLLATING SEQUENCE?
yes (next)
no (32)
THE STANDARD COLLATING SEQUENCE IS ASCII6. HERE IS THE WHOLE ASCII6 COLLATING SEQUENCE LISTED
!"#$X8»()*+,-./0123456789:;<=>?aABCDEFGHIJKLMNOPQRSTUVWXYZC\D-^_
THE KEY TYPE OF A CHARACTER KEY FIELD ORDERED ACCORDING TO A COLLATING SEQUENCE IS THE NAME OF THE
COLLATING SEQUENCE. THE KEY FIELD IS SPECIFIED BY NAMING THE FIRST CHARACTER POSITION AND THE
LENGTH OF THE FIELD.
THERE ARE FIVE PRE-DEFINED COLLATING SEQUENCES: DISPLAY, C0B0L6, ASCII6, EBCDIC6 AND INTBCD. THERE
CAN BE FROM 0 TO 100 USER-DEFINED COLLATING SEQUENCES.
DO YOU WANT TO DEFINE YOUR OWN COLLATING SEQUENCE?
yes (next)
no (32)
29. WHEN ASKED TO TYPE IN YOUR COLLATING SEQUENCE PLEASE TYPE IT IN AS C,C,C,C,C,C OR C,C,C,C,
c c
WHERE C IS A CHARACTER OR OCTAL VALUE.
C CAN BE A LETTER, A ONE-DIGIT NUMBER OR A SPECIAL CHARACTER SUCH AS ( ) + - *.
SORT/MERGE ASSUMES A TWO-DIGIT NUMBER IS AN OCTAL VALUE. (THE NUMBER SHOULD NOT BE FOLLOWED BY A
LETTER "B".) THE COMMA HAS TO BE SPECIFIED BY ITS OCTAL VALUE 56. HOW MANY COLLATING SEQUENCES DO
YOU WANT TO DEFINE?
number
30. WHAT IS THE NAME OF YOUR COLLATING SEQUENCE?
sequence-name
PLEASE TYPE IN YOUR COLLATING SEQUENCE.
C/C/
(30 if more to define)
(next if done defining)
DEFINING EQUATE MEANS SPECIFYING TWO OR MORE CHARACTERS ALREADY IN A COLLATING SEQUENCE AS EQUAL FOR
COMPARISON PURPOSES. MORE THAN ONE EQUATE COLLATING SEQUENCE MAY BE SPECIFIED FOR A COLLATING
SEQUENCE.
DO YOU WANT TO DEFINE EQUATES FOR YOUR COLLATING SEQUENCES?
yes (next)
no (32)
WHEN ASKED TO TYPE IN YOUR EQUATE SEQUENCE(S), PLEASE ENTER IN THE FORM C,C,C,C,C,C WHERE C IS A
CHARACTER OR OCTAL VALUE AS EXPLAINED BEFORE.
HOW MANY EQUATE SEQUENCES DO YOU WANT TO DEFINE?
number
31. WHAT IS THE NAME OF THE COLLATING SEQUENCE FOR THIS EQUATE?
sequence-name
PLEASE TYPE IN YOUR EQUATE SEQUENCE.
(31 if more to define)
(next if done defining)
32. YOU SHOULD KNOW THE NAME(S) OF ALL KEY TYPES YOU WANT TO USE. IF YOU DO NOT KNOW, START OVER BY
TYPING "RESTART" INSTEAD OF THE NUMBER OF KEY FIELDS.
(33)
'Not asked if you answered "yes" to the previous question about sort order.
''Repeated with successive numbers until all have been specified.
t"BITS" if you specified sum type INTEGER_BITS or BINARY_BITS.
++Not asked if you gave the file name in response to question 6.
Figure E-1. Interactive Dialog (Sheet 5 of 5)
60484800 A E-5
f^%
r*%
SORT/MERGE 5, SORT/MERGE 4 COMPARISON
Sort/Merge 5 is functionally equivalent to
Sort/Merge 4, but these versions of the product are
externally incompatible because the control state
ment for Sort/Merge 5 has been changed. Table F-l
shows a comparison of Sort/Merge 5 and Sort/Merge
4 . A s i n d i c a t e d i n t a b l e F - l , t h e S o r t / M e r g e 4
FORTRAN procedures can be called by Sort/ Merge 5
users, and the Sort/Merge 4 owncode exits can be
taken from FORTRAN 5.
Since Sort/Merge 5 procedures are compatible with
Sort/Merge 4 FORTRAN procedures, no changes are
needed to convert programs calling Sort/Merge 4
FORTRAN procedures FORTRAN compatible owncode
routines can be called by Sort/Merge 4 FORTRAN
procedures or by Sort/Merge 5 without any changes
to the owncode routines. All these Sort/Merge 5
relocatable binaries can be run by including LDSET
(LIB=SRT5LIB) in the load sequence before program
execution.
TABLE F-l. SORT/MERGE 5, SORT/MERGE 4 COMPARISON
Feature Sort/Merge 5 Sort/Merge 4
Control
Statement
Sort
Most sorts can be specified with the S0RT5
control statement and parameters alone.
A control statement sort requires a separate
directives section of the input file.
Merge Merge-only processing is available. Merge-only processing is available.
Key Types Sort keys can be 6-bit display code charac
ters, signed or unsigned binary integers,
or floating-point numbers.
Sort keys can be 6-bit characters written in
display code or internal BCD code, signed or
unsigned binary integers, or floating-point
numbers.
Collating
Sequences
ASCII6 (default), C0B0L6, DISPLAY, EBCDIC6,
and INTBCD are predefined. User-defined is
also available.
ASCII6 (default if installation character
set is ASCII), C0B0L6 (default if installa
tion character set is CDC), DISPLAY, and
INTBCD are predefined. User-defined is
also available.
Record
Types
Any CYBER Record Manager sequential record
type except U can be sorted.
Any CYBER Record Manager sequential record
type except U can be sorted.
Tape Sorts Tape files can be used as FROM and TO
files, but balanced and polyphase sorting
is not performed. Tape scratch files for
intermediate files is not supported.
A tape variant provides balanced and poly
phase tape sorting.
Checkpoint/
Restart
No t av ail a bl e . A job abnormally terminated can be captured
on tape so that the job can be restarted
from the checkpoint, rather than from the
beginning.
Interactive
Usage
Interactive dialog and commands are avail
able to aid in sort or merge specification.
No interactive dialog or commands are
available.
Procedure
Calls
Sort or merge can be initiated from within
a program (FORTRAN or other language) by a
series of procedure calls.
Sort or merge can be initiated from within
a COMPASS or FORTRAN program by a series of
procedure calls. The Sort/Merge 4 FORTRAN
procedures can be called by Sort/Merge 5
users.
Owncode
Routines
Routines can be written to process input
records, output records, or records with
equal keys during Sort/Merge processing.
Routines can be written to process input
records, output records, records with equal
keys, or nonstandard labels during Sort/
Merge processing. The Sort/Merge 4 FORTRAN
owncode exits can be taken by Sort/Merge 5
users.
COBOL C0B0L5 control statement option can specify
Sort/Merge 5 be used when COBOL SORT or
MERGE statement is executed, or direct
calls to the procedures can be made.
The interface is through the COBOL SORT or
MERGE statement; Sort/Merge 4 is the default
for sorts or merges from COBOL 5.
60484800 D F-l
INDEX
r
A l t e r
SEQA parameter 3-7
SM5SEQA procedure 5-5
Ascending (see Sort order)
ASCII6 (see Collating sequence)
Basic Access Methods (BAM) 3-1, 3-10, C-l
Batch processing 1-2
Beginning-of-information (BOI) C-l
BINARY (see Numeric data formats)
BINARY_BITS (see Numeric data formats)
Bit 2-1
Blanks (see Spaces)
Block
Definition C-l
Types 3-11
Byte 2-1, C-l
CALL statement 5-1
Character
Data 2-1
Definition C-l
S e t s A - l
COBOL
Control statement 1-2, 6-1
Sort/Merge procedures 6-1
C0B0L6 (see Collating sequence)
Collating sequence
ASCII6 2-2
C0B0L6 2-2
Definition 1-1, 2-2, C-l
DISPLAY 2-2
EBCDIC6 2-2
INTBCD 2-2
User-defined
SEQx parameters 3-5
SM5SEQx procedures 5-4
Commas 3-1, 3-9, 4-5
Configuration
Hardware 1-2
Software 1-2
Continuation lines 3-1
Control statement (see FILE control statement, MERGE
control statement, S0RT5 control statement)
CYBER Control Language (CCL)
Definition C-l
ENR parameter 3-4
STATUS parameter 3-7
CYBER Record Manager (CRM) 1-1, C-l
Data alignment 2-1
Dayfile messages 5-4
Default
Definition C-l
File characteristics 1-1, 3-11
Descending (see Sort order)
DIA parameter (see DIALOG parameter)
D i a g n o s t i c s B - l
Dialog (see Interactive dialog)
DIALOG parameter 3-2, 3-4, 4-2, D-l
DIR parameter 3-3, D-l
Directive files
Continuation 3-2
D e n i t i o n 1 - 1 , C - l
DIR parameter 3-3
Example 8-4
Format 3-1
Length 3-1
Use 1-1, 3 -1, 8 -4
DISPLAY (see Collating sequence)
Display code C-l
Duplicate parameters 3-2
E parameter 3-4, D-l
EBCDIC6 (see Collating sequence)
EL parameter 3-4, D-l
End-of-file 3-2, 5-2
End-of-information (EOI) C-l
End-of-record 3-2, 5-2
ENR parameter 3-4, D-l
ENTER statement 6-1
Entry point C-l
Error
Codes
SM5ST procedure 5-5
STATUS parameter 3-7
Level 3-4, 5-3, B-l
Messages B-l
Status variable
SM5ST procedure 5-5, B-l
STATUS parameter 3-7, B-l
Equal keys
Owncode 5 7-4
RETAIN parameter 3-5
SM5RETA procedure 5-4
Summing
SM5SUM procedure 5-6
SUM parameter 3-8
Examples
Control statement merge 8-3
Control statement sort
Multiple keys 8-3
One key 8-1
Directive file
Creation 8-4
Use 8-4
Interactive commands 4-4
Interactive dialog 8-1
I n t e r a c t i ve p a r a m e t e r s p e c i c a t i o n 4 - 5
NOS login 4-1
NOS/BE login 4-2
Output file disposition 4-4
Owncode routine 8-9
Procedure calls 8-7
EXTERNAL statement 5-4, 7-1
FASTIO parameter 3-9, D-l
Features 1-1
Field length require m e n t s 3-11
60484800 D Index-1
File
Definition C-2
Description 1-1, 3-10
Format
Data file 3-2, 5-2
Directive file 3-1
Error file 3-4, 5-3
Listing file 3-3
Local C-2
Organization 3-10
FILE control statement
Description 1-1, 3-10, C-2
DIR parameter 3-3
FASTIO parameter 3-9
Format 3-10
FROM parameter 3-2
Interactive 4-3, 4-4
L parameter 3-3
Owncode routine 7-1
SM5E procedure 5-3
SM5FAST procedure 5-4
SM5FR0M procedure 5-2
SM5T0 procedure 5-2
TO parameter 3-2
File information table (FIT) 3-10, C-2
Floating-point numbers 2-5, C-2
FORTRAN programs 1-1, 5-1, 7-1
FROM parameter 3-2, D-l
Graphic A-l, C-2
3-5, 5-4
L parameter 3-3, D-l
Leading blanks 2-2
Library C-2
L i s t i n g l e 3 - 3
Literal C-2
Loading
Owncode routines
Procedures 5-1
Lo g ic al l e n a me (l fn ) C - 2
Logical record C-2
Login 4-1, C-2
Logout 4-5, C-2
Major sort key 2-1, C-2
Mass storage C-2
MERGE control statement
/*^%.
3-1, 4-5
Continuation
Format 3-1, 4-5
Length 3-1, 4-5
Punctuation
Merge order 3-9
Merging
Control statement
Definition C-3
I n i t i a t i o n 1 - 1 , 5 - 6
Procedure call 5-1
Purpose 1-1
Minor sort key 2-1, C-3
Multiple sort keys 2-1
3-1, 4-5
3-1
HELP command 4-3
Input files
FROM parameter 3-2
Owncode routine processing 7-3
SM5FR0M procedure 5-2
INTBCD (see Collating sequences)
In t eg er C- 2
INTEGER (see Numeric data formats)
INTEGER_BITS (see Numeric data formats)
Interactive commands 4-3
Interactive dialog
Te x t E - l
Use 1-1, 4-2, 8-1
Int e ractive processin g 1-2, 4-1, C-2
INTERCOM 1-2, C-2
In te r n a l re p r e se nt at i o n 2 -2
Job
Definition C-2
Flow
Batch 1-3
Interactive 1-4
Structure
Control statement merge
Control statement sort
D i r e c t i v e l e u s e 8 - 7
Procedure calls 8-7
KEY parameter 3-2, D-l
Keys (see Sort keys)
Keyword
Definition C-2
Sort/Merge parameters 3-2
8-3, 8-4
8-3
Network Access Method (NAM) 1-2
Noncharacter data 2-1
NOS 1-2
NOS/BE 1-2
Notations ix
Numeric data formats
BINARY 2-4
BINARYJBITS 2-4
INTEGER 2-4
INTEGER_BITS 2-4
NUMERIC_FS 2-4 '
NUMERICJ.0 2-4
NUMERICJ.S 2-4
NUMERIC_NS 2-4
NUMERICJTO 2-4
NUMERICJTS 2-4
REAL 2-4
NUMERICJFS (see Numeric data formats)
NUMERICJLO (see Numeric data formats)
NUMERICJLS (see Numeric data formats)
NUMERIC_NS (see Numeric data formats)
NUMERICJTO (see Numeric data formats)
NUMERIC TS (see Numeric data formats)
OFL parameter (see OWNFL parameter)
0MRL parameter (see OWNMRL parameter)
Order (see Sort order)
Output files
Owncode routine processing 7-4
SM5T0 procedure 5-2
TO parameter 3-2
Overflow
SM5SUM procedure 5-6
SUM parameter 3-8
Overpunch character representation 2-5
r**E%
Index-2 60484800 D
0^s
r
Owncode routines
Calling sequence 3-5
Definition 1-2, 7-1, C-3
File 3-5
Loading 3--5, 7-1
Name 3-5, 5-4
Owncode 1 7-2
Owncode 2 7-3
Owncode 3 7-3
Owncode 4 7-4
Owncode 5 7-4
Parameters 7-1
Record length 3-5, 5-4
Summary 7-2
OWNF parameter 3-4, 7-1, D-l
OWNFL parameter 3-5, 7-1, D-l
OWNMRL parameter 3-5, D-l
OWNn parameter 3-5, 7-1, D-2
Parameter
Definition C-3
Owncode routine 7-1
Sort/Merge 3-2, D-l
Partition C-3
Periods 3-1
Physical record unit (PRU) C-3
Positional parameters 3-2, 3-10
Procedure calls
Definition 1-1, C-3
Loading 5-1
Order 5-1
Owncode routines 7-1
Record length 5-1
Result array 5-1
Punctuation (see Commas, Periods, Spaces)
QUIT command 4-3
Range ix, 3-1, 3-7
REAL (see Numeric data formats)
n „ _ _ 7 _ l f 7 _ 2
7 - 1 , 7 - 2 *
Reca parameter
Recb parameter
Record
Definition C-3
Estimated number
ENR parameter 3-4
SM5ENR procedure 5-3
Length
Owncode routine 3-5, 5-4
Specification 3-11, 5-1
Type 1-1, 3-11, C-3
Relocatable C-3
Resource map 3-3
RESTART command 4-3
Result array 5-1, C-4
RET parameter (see RETAIN parameter)
RETAIN parameter 3-5, D-2
Return_code parameter 7-1
Rewind C-4
REWIND statement 5-2
Rla parameter 7-1
Rib parameter 7-1
3-7, D-2
3-5, D-2
3-7, D-2
3-6, D-2
2-2, C-4
5-3
5-4
5-2
5-2
5-2
5-4
5-4
5-4
5-4, 7-1
5-4
5-5
5-5
5-5
5-5
Section C-4
S e q u e n ti a l l e 3-11, C-4
SEQx parameters
SEQA parameter
SEQN parameter
SEQR parameter
SEQS parameter
Signed numeric data
SM5E procedure 5-3
SM5EL procedure 5-3
SM5END procedure 5-7
SM5ENR procedure
SM5FAST procedure
SM5FR0M procedure
SM5KEY procedure
SM5MERG procedure
SM5N0DA procedure
SM50FL procedure
SM50MRL procedure
SM50WNn procedure
SM5RETA procedure
SMSSEQx procedures
SM5SEQA procedure
SM5SEQN procedure
SM5SEQR procedure
SM5SEQS procedure
SMSSORT procedure 5-1
SM5ST procedure 5-5
SM5SUM procedure 5-6
SM5T0 procedure 5-2
Sort keys
Definition 1-1, 2-1, C-4
Key length
General 2-1
KEY parameter 3-2
SM5KEY procedure 5-2
Key position
General 2-1
KEY parameter 3-2
SM5KEY procedure 5-2
Key type
General 2-1, C-2
KEY parameter 3-2
SM5KEY procedure 5-2
S i z e 2 - 1
Sort/Merge 4 F-l
Sort order
Ascending
KEY parameter 3-2
SM5KEY procedure 5-2
D e n i t i o n 2 - 5 , C - 4
Descending
KEY parameter 3-2
SM5KEY procedure 5-2
Sorting
Control s t a t e m e n t 3-1
Initiation 1-1, 5-6
Procedure call 5-1
Purpose 1-1
S0RT5 control statement
Continuation 3-1, 4-5
Format 3-1, 4-5
Length 3-1, 4-5
Punctuation 3-1, 4-5
Spaces 3-1, 4-5
ST parameter (see STATUS parame
STATUS parameter 3-7, D-2
Sum fields
Example 3-9, 5-6, 8-7
Number 3-8, 5-6
Overflow 3-8, 5-6
Type 3-8, 5-b
ter)
0ps
60484800 D Index-3
I Summing 1-1, 3-8, 5-6
SUM parameter 3-8, D-2
System-logical-record C-4
Terminal
Access (see Login)
Connection 4-1
TO parameter 3-2, D-2
Value-set
Description 3-2
KEY parameter 3-2
SUM parameter 3-8
Value step
SEQS parameter 3-6
SM5SEQS procedure 5-5
VER parameter (see VERIFY parameter)
VERIFY parameter 3-9, D-2
Unit record format 4-2
Unsigned numeric data 2-2
User-defined collating sequences
SEQx parameters 3-5
SM5SEQx procedures 5-5
Word C-4
$CHAR(n) 3-b
Index-4 60484800 D
A^tms
MANUAL TITLE: Sort/Merge Version 5 Reference Manual
Ji^s
0ms
PUBLICATION NO.: 60484800
REVISION: D
This form is not intended to be used as an order blank. Control Data Corporation
welcomes your evaluation of this manual. Please indicate any errors, suggested
additions or deletions, or general comments on the back (please include page number
references).
FOLD
Please reply No reply necessary
FOID
BUSINESS REPLY MAIL
NO POSTAGE
NECESSARY
IF MAILED
IN THE
UNITED STATES!
FIRST CLASS PERMIT NO. 8241 MINNEAPOLIS, MN.
POSTAGE WILL BE PAID BY ADDRESSEE
CONTRPL DATA
Technology and Publications Division
Mail Stop: SVL104
P.O. Box 3492
Sunnyvale, California 94088-3492
r
i
! F O L D FOLD
NO POSTAGE STAMP NECESSARY IF MAILED IN U.S.A.
FOLD ON DOTTED LINES AND TAPE
NAME:
COMPANY:
STREET ADDRESS:
CITY/STATE/ZIP;
TAPE TAPE
"^1

Navigation menu