GCOBOL-START(3c) | 3c (gcc cobol) | GCOBOL-START(3c) |
START
— position
file for reading
boxht = 1/6 + 1/16 boxrad = 1/16 arcrad = 1/16 circlerad = 1/24
E0: circle line right
Start: box "START" line right Filename: box "filename" arrow right to (5.0, Here.y)
line invis down 2/6 from E0.c E0: arrow right 1/16 line
First: box "FIRST" arc cw from E0.start E1: line down 1/6 arc ccw line right linewid - arcrad Last: box "LAST" E2: line down 1/6 + 2 * arcrad from E1.end arc ccw line right linewid - arcrad Key: box "KEY" arc cw line down 1/6 arc ccw Is: box "IS" arc ccw dist = Key.e.y - (Here.y + arcrad) line up dist arc cw line from Key.e to Here CompareOperator: box rad 0 height boxht * 1.5 dashed 1/32 "compare" "operator" line right Name: box "name" arc ccw line to (Here.x, Last.e.y + arcrad) arc cw down line from Last.e to Here move to last arc .start line to (Here.x, First.w.y - arcrad) arc up cw line from First.e to Here arrow right to (5.0, Here.y)
line invis down 7/6 from E0.start E0: arrow right 1/16
arc cw line down 1/8 + 1/6 arc ccw line right linewid - arcrad Key: box "WITH" arc right ccw line up 1/6 - arcrad arc cw Length: box "LENGTH" line right 2 * arcrad Statements: box "expr" arc ccw line to (Here.x, E0.end.y - arcrad) arc up cw line from E0.end to Here arrow right to (5.0, Here.y)
line invis down 5/6 from E0.start E0: arrow right 1/16
arc cw line down 1/6 arc ccw line right linewid - arcrad Invalid: box "INVALID" arc cw line down 1/6 arc ccw Key: box "KEY" arc right ccw line to (Here.x, Invalid.e.y - arcrad) arc cw line from Invalid.e to Here Statements: box width 1.5 * boxwid "error-statements" arc ccw line to (Here.x, E0.end.y - arcrad) arc up cw line from E0.end to Here arrow right to (5.0, Here.y)
line invis down 5/6 from E0.start E0: arrow right 1/16
arc cw line down 1/6 arc ccw line right linewid - arcrad NotInvalid: box height boxht * 1.5 "NOT" "INVALID" arc cw line down 1/6 arc ccw Key: box "KEY" arc right ccw line to (Here.x, NotInvalid.e.y - arcrad) arc cw line from NotInvalid.e to Here Statements: box width 1.5 * boxwid "valid-statements" arc ccw line to (Here.x, E0.end.y - arcrad) arc up cw End: line from E0.end to Here arc cw right line down 1/6 arc ccw down box width 1.5 * boxwid "END-START" arc ccw right line up 1/6 arc cw up line from End.end to (5.5, Here.y) circle
START
sets the position within
filename where the next sequential READ will read a
record by applying compare operator (see below) to a
key for the file. filename is an
FD
entry in DATA
DIVISION
.
When none of FIRST
,
LAST
, or KEY
, is specified,
START
defaults to KEY EQUAL
with the primary key of filename as the key. If
KEY
is used, name specifies
the name of a key field or named key for filename.
Alternatively, name may specify a field whose leftmost
character is at the beginning of a key for
filename.
FIRST
and LAST
are
valid for files whose ORGANIZATION
is
RELATIVE
, or INDEXED
. For
SEQUENTIAL
files, one of
FIRST
or LAST
is required.
FIRST
positions the file at the first record
according the file's key (or, for SEQUENTIAL
, at the
first physical record); LAST
similarly positions the
file at the last record. If the file is empty, FIRST
and LAST
produce an error condition, with
FILE-STATUS
set according the file's
organization.
LENGTH
is valid only for a file with
INDEXED
organization. The whole key is used unless
LENGTH
is used, in which case
expr is an arithmetic expression resulting in an
integer value constituting the size of the key.
In its conditional form, START
may include
either or both of INVALID KEY
and
NOT INVALID KEY
.
error-statements and
valid-statements are blocks of statements. If no
record exists matching the KEY
criteria,
error-statements are executed. If a matching record is
found, valid-statements are executed.
END-START
marks the end of the
START
statement. It can be required when
START
appears in a conditional statement.
E0: arrow 1/16 arc cw line down 1/6 arc ccw Is: box "IS" arc ccw line to (Here.x, E0.end.y - arcrad) arc up cw; arc cw line down 1/6
arc ccw Not: box "NOT" Not_end: arc right cw arc cw right from (Not.e.x, E0.end.y) line to Not_end.end move to (Here.x, E0.end.y) line from E0.end to Here
# "=" E0: line right arcrad Equal: box "EQUAL" arc cw line down 1/6 arc ccw To: box "TO" arc right ccw line to (Here.x, Equal.c.y - arcrad) arc up cw line from Equal.e to Here arrow to (6.0, Here.y)
# "< <= = > >= symbolically" E0: line from Not_end.end down 2/6 + 2 * arcrad arc ccw ## line right 1/4 - 2 * arcrad Less: box "<" line right boxwid + 2 * arcrad Less_end: arc right ccw line to (Here.x, To.e.y + arcrad)
E0: line down 2/6 + 2 * arcrad from E0.end arc ccw ## line right 1/4 - 2 * arcrad Lt: box "<=" line right boxwid + 2 * arcrad Lt_end: arc right ccw line to (Here.x, E0.start.y)
E0: line down 2/6 + 2 * arcrad from E0.end arc ccw ## line right 1/4 - 2 * arcrad EqSym: box "=" line right boxwid + 2 * arcrad Equal_end: arc right ccw line to (Here.x, E0.start.y)
E0: line down 2/6 + 2 * arcrad from E0.end arc ccw ## line right 1/4 - 2 * arcrad Gt: box ">=" line right boxwid + 2 * arcrad Gt_end: arc right ccw line to (Here.x, E0.start.y)
E0: line down 2/6 + 2 * arcrad from E0.end arc ccw ## line right 1/4 - 2 * arcrad Greater: box ">" line right boxwid + 2 * arcrad Greater_end: arc right ccw line to (Here.x, E0.start.y)
# "< and <=" E0: line down 2/6 from E0.end arc ccw ## line right 1/4 - 2 * arcrad Less: box "LESS" arc cw line down 1/6 arc ccw Than: box "THAN" Than_end: arc right ccw line to (Here.x, Less.c.y - arcrad) arc up cw arc right cw line down 1/6 arc ccw OrEq: box "OR EQUAL" arc cw line down 1/6 arc ccw To: box "TO" arc right ccw line from OrEq.e to (To.e.x, OrEq.e.y) arc right ccw line from Less.e to (To.e.x, Less.e.y) arc right ccw
# "> and >=" E0: line down 5/6 from E0.end arc ccw ## line right 1/4 - 2 * arcrad Greater: box "GREATER" arc cw line down 1/6 arc ccw Than: box "THAN" Than_end: arc right ccw line to (Here.x, Greater.c.y - arcrad) arc up cw arc right cw line down 1/6 arc ccw OrEq: box "OR EQUAL" arc cw line down 1/6 arc ccw To: box "TO" To_end: arc right ccw line from OrEq.e to (To.e.x, OrEq.e.y) arc right ccw line from Greater.e to (To.e.x, Greater.e.y) arc right ccw
line from To_end.end to (Here.x, Equal.c.y - arcrad) arc up cw
June 2023 | Linux |