Substring fields

You can use the SST keyword to specify which fields (character, hexadecimal, or zoned decimal) are in a substring. You can also use substring with a packed field in a physical file by specifying S (zoned decimal) as the data type in the logical file.

For example, assume that you defined the Date field in physical file PF1 as 6 characters in length. You can describe the logical file with three fields, each 2 characters in length. You can use the SST keyword to define MM as 2 characters starting in position 1 of the Date field, DD as 2 characters starting in position 3 of the Date field, and YY as 2 characters starting in position 5 of the Date field.

The following example shows the field descriptions in data description specifications (DDS) for these substring fields. The SST keyword is used to specify the field to substring.

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
     A          R REC1                      PFILE(PF1)
     A
     A            MM                 I      SST(DATE 1 2)
     A            DD                 I      SST(DATE 3 2)
     A            YY                 I      SST(DATE 5 2)
     A
Note: The starting position of the substring is specified according to its position in the field being operated on (Date), not according to its position in the file. The I in the Usage column indicates input-only.

Substring fields can also be used as key fields and select/omit fields.