Use this field-level keyword to specify a character string that
is a subset of an existing character, hexadecimal, zoned field, or graphic.
The format of the keyword is:
SST(field-name starting-position [length])
The
field-name parameter specifies the name of the field from which the substring
is taken. This field must be defined in the same logical file format before
the SST field (which is the field you are defining) or it must exist in the
physical file specified on the PFILE or JFILE keyword. To find the field,
the system searches for a matching field name as follows:
- First, the system searches the field names specified in positions 19 to
28 in the logical file format before the SST field.
- If no matching field name is found in positions 19 to 28 in the logical
file format, the system searches for the field name in the physical file specified
on the PFILE or JFILE keyword, according to the following rules:
- If the logical file is a simple or multiple format logical file, the field
must exist in all files specified on the PFILE keyword.
- If the logical file is a join logical file and the JREF keyword is specified
on the SST field, the field must exist in the JFILE referred to by the JREF
keyword.
- If the logical file is a join logical file and the JREF keyword is not
specified on the SST field, the field must exist in exactly one JFILE.
The substring begins at the starting position you specify on the
SST keyword. Specify its length either as the third parameter on the keyword
or on the field length (DDS positions 30 through 34). The starting position
is a required parameter; the length is optional.
Note: Both the starting
position and length values must be positive integer values and the defined
substring must not be greater than the length of the field specified on the
SST keyword.
The following rules apply:
- If the field on the SST keyword is binary character, the resulting field
is binary character; if the field on the SST keyword is hexadecimal, the resulting
field is hexadecimal; if the field on the SST keyword is DBCS-graphic, the
resulting field is DBCS-graphic; otherwise, the resulting field is always
character. If the data type is not specified in DDS, the result field's data
type depends on the sub-stringed field as shown in the following table (the Source
field type is the type of the physical file field or the logical file
field defined earlier in the logical file source):
Source field type |
Logical file field becomes: |
A |
A |
H |
H |
S |
A |
G |
G |
Binary character |
Binary character |
- The use of the resulting field must be either input-only (I) or neither
(N).
- The length of the resulting field is optional. You must specify either
the field length or the length parameter on the keyword. If you specify both,
they must be equal. If the field length is not specified, it is assigned the
length parameter on the keyword.
- You cannot specify this keyword on the same field with the CONCAT, RENAME,
or TRNTBL keywords.
- The field specified on this keyword cannot be defined with the CONCAT,
TRNTBL, or SST keywords.
Examples
The following examples show how to specify
the SST keyword.
The following example shows how to specify the SST
keyword on a join logical file.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A R RECORD1 JFILE(PF1 PF2)
A J JOIN(1 2)
A JFELD(CITY CITY)
A ADDRESS JREF(2)
A CITY I SST(ADDRESS 21 10)
A JREF(2)
A SYEAR I SST(SALESDATE 5)
A NAME JREF(1)
A CUSTNAME I SST(NAME 11 10) JREF(2)
A K SYEAR
A
This example shows:
- CITY is a substring of ADDRESS from the logical format and is joined with
CITY from PF1.
- CUSTNAME is a substring of NAME from PF2, since NAME in the logical file
format has a different JREF.
- Since SYEAR is a key field, the unique field name SALESDATE must exist
in PF1.
- The usage (position 38) for a field with the SST keyword must be I (input
only). Because this is a join logical file, the usage default
is I.
The following example shows how to specify the SST keyword on
a simple or multiple format logical file.
|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
A R REC1 PFILE(PFA)
A LASTNAME I SST(NAME 10 10)
A K LASTNAME
A
The LASTNAME field is a substring of NAME from PFA. The
usage I in position 38 must be specified for SST fields in simple or multiple
format logical files.