semi合集-English.pdf - 第1228页
SEMI E5-1104 © SEMI 1982, 2004 170 10.17.2. 9.3 The size of the secondary message may be less because of l imited reso urces in the sendi ng system. 10.17.2. 9.4 For data sets with Discrete records, the for- mat of each …

SEMI E5-1104 © SEMI 1982, 2004 169
2. The beginning of the data set has Checkpoint value
with all bits reset.
3. A Checkpoint with all bits set is illegal.
4. A Checkpoint supplied by the sending system
which does not have all bits set is usable in an
OPEN transaction to restart a data transfer without
any lost data or duplicated data.
10.17.2.5.2 The receiving system defines the initial
Checkpoint in the primary message of the OPEN trans-
action. The sending system returns the next Checkpoint
in the response to each READ.
10.17.2.6 Read Length — The Read Length must be
supplied by the receiving system with each READ
transaction. It specifies the maximum number of data
bytes which that system is prepared to process at one
time. The sending system may supply less if it has lim-
ited resources. The sending system may supply more if
ReadLength is zero, or is smaller than RecordLength.
10.17.2.7 Reading a Data Set — The basic data
transfer is initiated with the OPEN transaction and
completed with the CLOSE transaction. Information is
sent from the sending to the receiving systems by a
series of READ transactions.
10.17.2.8 OPEN Transaction — The receiving system
sends a primary message containing the DataSet Name
of the desired data set, the Handle to be used, and the
Checkpoint of the initial READ transaction. The
response from the sending system is a secondary mes-
sage with a return code and the RecordType and
RecordLength of the data set. If the return code is one
of the error codes, then no data set was opened and the
values of RecordType and RecordLength are undefined.
If the RecordType is Stream, then the value of
RecordLength is undefined. Notice that the undefined
items will still appear in the secondary message.
10.17.2.8.1 The return code in the secondary message
is one of the following:
OK.
ERROR: Unknown Data Set ID.
ERROR: Try later (i.e., the data set is in use).
ERROR: Too many open data sets.
ERROR: Data set open too many times.
ERROR: Handle in use.
ERROR: Pending Transaction.
10.17.2.9 The READ Transaction — The receiving
system sends a primary message which contains the
Handle, and the ReadLength. The sending system
responds with a secondary message which has a return
code, the next Checkpoint, and zero or more items with
data. At least one data item must be supplied unless
there is an error. The return codes are:
OK.
ERROR: End of Data.
ERROR: No open Data Set (i.e., incorrect Handle).
ERROR: Cannot continue (i.e., a disk read error on the
sending system).
ERROR: Pending Transaction.
10.17.2.9.1 Any READ transaction which follows a
READ which returned an error, except “Pending
Transaction,” will generate the same error. The value
of Checkpoint must be illegal (i.e., all bits must be set)
when the “End of Data,” “No open Data Set,” or
“Pending Transaction” error is returned. The value of
Checkpoint error must be a value from which recovery
may be attempted without duplicating data when the
“Cannot continue” error is returned. Recovery may be
attempted by issuing a CLOSE, followed by an OPEN
with the last value of Checkpoint, and then another
READ.
10.17.2.9.2 Each secondary message for the READ
transaction must contain a whole number of Discrete
records. A record may be sent as an ASCII or a binary
item. Stream data sets are broken into pieces by the
READ transaction without regard to internal structure.
Each piece would be sent as a single binary item. The
number of items which contain data depends on the
RecordType, Record Length, and Read Length. The
algorithm is designed so that the maximum length of
the secondary message is deterministic. It gives the
receiving system the ability to control the amount of
resources (such as SECS-I buffers) which it must allo-
cate. The sending system may send less data than the
maximum if it has limited resources. The performance
(i.e., the packing of records into a message of some
maximum size) should be very good for the case where
records are all nearly the maximum length. This is
assumed to be the usual case. The efficiency in patho-
logical cases (e.g., many short records) will not be
good, but the algorithm is robust enough to accommo-
date this without exceeding the maximum message size.
NOTE 13: If the RecordType is Stream, then there is exactly
one item with a binary format whose length is not more than
ReadLength. If the RecordType is Discrete, then the
maximum number of items, MaxItems, is calculated by the
formula:
thRecordLeng
ReadLength
int,1maxMaxItems

SEMI E5-1104 © SEMI 1982, 2004 170
10.17.2.9.3 The size of the secondary message may be
less because of limited resources in the sending system.
10.17.2.9.4 For data sets with Discrete records, the for-
mat of each item is either ASCII (format 20) or binary
(format 10). There is no requirement that all records be
in the same format, but mixed record formats are not
encouraged. Items with ASCII format should have only
data characters. Characters which the sending system
uses for control information (e.g., newline for a record
terminator) should not appear. If an application finds it
necessary to include these characters, then format 10, or
Stream should be used.
10.17.2.10 CLOSE Transaction — This transaction ter-
minates a data transfer and frees the Handle for future
use. The primary message is sent by the receiving sys-
tem and contains only the Handle. The sending system
responds with a secondary message which has a return
code.
10.17.2.10.1 The return code is one of the following:
OK.
ERROR: No open Data Set (i.e., incorrect Handle).
ERROR: Pending Transaction.
10.17.2.11 Sending a Data Set — Writing a data set is
performed by requesting that the receiving system read
it. The sending system initiates the SEND transaction
to request that a data set be read. The receiving system
is expected to perform the OPEN, READ, and CLOSE
transactions to transfer the data set if it accepts the
request. The time between the secondary message of
the SEND and the primary message of the OPEN
depends on the application.
10.17.2.12 The SEND Transaction — The primary
message sent from the sending system to the receiving
system contains the Data Set Name.
10.17.2.12.1 The secondary message contains the Data
Set Name and a return code which is one of the follow-
ing:
OK.
ERROR: Unknown Data Set Name.
ERROR: Try later (i.e., the system is busy).
10.17.2.13 Error Recovery — The receiving system
may crash while a data set is open but no READ trans-
action is pending. The sending system will not be able
to tell that this has happened because there is no time-
out value defined between READ transactions. When
the receiving system is restarted it may have forgotten
which data sets were open. States in the two systems
are now inconsistent.
10.17.2.14 RESET Transaction — The RESET transac-
tion offers a way to resynchronize the two systems.
When one system issues the primary message of the
RESET transaction, it is informing the other system that
any data sets which may have been open are to be
closed. This applies to all data sets open between both
systems. It is not necessary to issue CLOSE transac-
tions for each individual data set because the RESET
transaction is a global close.
10.17.2.15 Any equipment which uses Stream 13 must
issue the RESET transaction as part of its initialization
or bootstrap procedure. A host system must issue a
RESET to equipment which uses Stream 13 during the
initialization for that equipment.
10.17.2.16 SECS-II Protocol Definition —
Figure 11
shows the state diagram for the sending system while a
data set is being transferred. Each circle shows a possi-
ble state of the sending system. The names of these
states are for reference only. They are not meant to
suggest an implementation. The arrows show transi-
tions due to SECS-II messages received or sent by the
sending system.
10.17.2.16.1 In the initial state (Idle) handle X is not
open. The states marked with an asterisk are those in
which a transaction is outstanding. If the sending sys-
tem receives any primary message from the receiving
system with handle X during the time it is in these
states, then the secondary message for that transaction
will contain the “Pending Transaction” error code, but
the original transaction for handle X will not be
affected. Some states, especially the error states, may
take zero time in some implementations. In these cases,
the “Pending Transaction” error code would not be
returned from those states.
10.17.3 Formatted Data Sets — Formatted data sets
are data sets transferred in a standard format. Stream
13 provides a method for transferring data sets in a
table format. A table has both attributes and content.
The attributes of the table provide information about the
data set as a whole, such as the date and time that it was
last modified, its size, etc. The content of the table
consists of column headers and rows. A row is an
ordered list of table elements. A column refers to all
table elements at a specific position within all rows,
where each column is identified by a corresponding text
string as a column header. The table elements in the 1st
column position are used as an identifier for the row.

SEMI E5-1104 © SEMI 1982, 2004 171
Stream,Function Name (Mnemonic) Direction
S13,F0 Abort Transaction (S13F0) S,H<->E
Description
Same form as S1,F0.
Structure
Exception
Stream,Function Name (Mnemonic) Direction
S13,F1 Send Data Set Send (DSSS) S,H<->E,reply
Description
Sent by the sending system to request that the other system read a dataset.
Structure
L,1
1. <DSNAME>
Exception
None
Stream,Function Name (Mnemonic) Direction
S13,F2 Send Data Set Acknowledge (DSSA) S,H<->E
Description
Sent by the receiving system in response to Send Data Set Send.
1. <DSNAME>
2. <ACKC13>
Structure
Exception
The possible ACKC13 codes for this message are:
0 = O.K.
1 = ERROR:Try later.
2 = ERROR:Unknown Data Set Name.
Stream,Function Name (Mnemonic) Direction
S13,F3 Open Data Set Request (DSOR) S,H<->E,reply
Description
Sent by the receiving system to open a data set for reading.
Structure
L,3
1. <HANDLE>
2. <DSNAME>
3. <CKPNT>
Exception
None