Host/API | | Typical HOST Program Layouts |
Program Layout
Column four in the typical HOST
program layout on below
identify options on the basic steps through which a typical HOST
program moves.
The comments in the examples refer to these steps.
A Typical HOST
Program Layout
Step 1 Initialise the system: Call ZSTART (1.A)
and login into MASTER if Call ZLOGIN (1.B)
necessary:
Step 2 Open the database: Call ZORDB or
ZOSDB
Step 3 Start a case block on the Call
stack: ZCCNT(D) or
ZCIS(D) or
ZCSAM(D)
Step 4 If no key processing is done,
skip to step 5.
If a single value is used for Call ZWITH (4.A)
the key( "WITH" ) then:
Call key definition routines (4.B)
in the order the sort-ids
appear in schema definition.
Skip to step 5.
If a range of keys is to be Call ZFROM or (4.C)
specified and a low limit is re- ZAFTER
quired:
Call key definition routines (4.D)
in the order that the sort-ids
appear in schema definition.
If no high limit on the key
range is required, skip to step
5.
If a range of keys is to be Call ZTHRU or (4.E)
specified and a high limit is ZUNTIL
required:
Call key definition routines in (4.F)
the order the sort-ids appear
in schema definition.
Step 5 End the key processing and Call ZCNEXT
retrieve one case in range. or ZCPREV or
ZCFRST or
ZCLAST
If there are cases to delete Call ZCDEL
If there are cases to be
processed then continue with
Step 6, otherwise skip to Step
13 to end the case-block
processing.
Step 6 For the case level process-
ings, call routines that trans-
fer data to and from CIR vari-
ables.
Step 7 Start a record processing Call
block: ZRCNT(D) or
ZRIS(D) or
ZRSAM(D)
Step 8 If no key processing is done,
skip to step 9.
If a single value is used for Call ZWITH ( 8.A)
the key "WITH" then:
Call key definition routines in (8.B)
the order the sort-ids appear
in schema definition.
Skip to step 9.
If a range of keys is to be Call ZFROM or (8.C)
specified and a low range is ZAFTER
required then:
Call key definition routines in (8.D)
the order that the sort-ids
appear in schema definition.
If no high limit on the key
range is required, skip to step 9.
If a range of keys is to be Call ZTHRU or (8.E)
specified and a high limit is ZUNTIL
required:
Call key definition routines in (8.F)
the order that the sort-ids
appear in schema definition.
Step 9 End the key processing and Call ZRNEXT
retrieve one record in range: or ZRPREV
or ZRFRST
or ZRIAST
If there are records to be
processed, then continue
with Step 10. Otherwise, skip
to Step 11.
Step 10 Record level processings. (10.A)
Call routines that transfer
data to and from the record
variables.
If the record is to be deleted Call ZRDEL (10.B)
then:
Continue with Step 9 to
process a new record.
Step 11 End record-block processing: Call ZREXIT
Step 12 Perform additional case Call routines (12.A)
processing. that transfer
data to and from
CIR variables.
If the case is to be deleted Call ZCDEL (12.B)
then:
Continue with Step 5 to
process a new case.
Step 13 End of case-block processing: Call ZCEXIT
Step 14 Close the database down: Call ZENDDB
Step 15 Shut down the whole HOST Call ZEND
system:
Another Typical HOST
Program Layout
.
(1) Call ZSTART then ZLOGIN
(2) Call ZORDB or ZOSDB
(3) Call ZCGDMY
(4) Call routines to transfer values into case-ids variables
(5) Call ZCFIND
(6) Ordinary case processing calls
(7) If case is brand new and update mode: Call ZCWRIT
(8) Call ZRGDMY
(9) Call routines to transfer values Into record-ids
variables
(10) Call ZRFIND
(11) Ordinary record processing calls
(12) K record is to be written call ZRWRIT If record
is to be deleted call ZRDEL
(13) To process a new record call ZRREST and
continue with (9)
(14) Call ZREXIT when record processing is over
(15) Ordinary case processing calls
(16) If CIR variables were modified and/or records were
added/deleted call ZCWRIT
if case is to be deleted call ZCDEL
(17) To process a new case call ZCREST and continue with (4)
(18) Call ZCEXUT when case processing Is over
(19) Call ZENDDB
(20) Call ZEND