CONCAT (Concatenate) Keyword in Logical Fields Only--Examples

Figures Figure 27 through Figure 30 show how to specify the CONCAT keyword.

MTH, DAY, and YEAR are fields in the physical file that are concatenated into one field DATE in the logical file, as shown in Figure 27.

Figure 27. Specifying the CONCAT Keyword (Example 1)

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RECORD1                   PFILE(PF1)
00020A            DATE                      CONCAT(MTH DAY YEAR)
     A

In Figure 28, if the program changes DATE from 01 03 81 to 02 05 81, the value placed in the physical record does not change because the fields specified last are MTH (value 01), DAY (value 03), and YEAR (value 81). However, if MTH, DAY, and YEAR are changed to new values, the value of DATE in the physical record also changes.

Figure 28. Specifying the CONCAT Keyword (Example 2)

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RECORD2                   PFILE(PF1)
00020A            DATE                      CONCAT(MTH DAY YEAR)
00030A            MTH
00040A            DAY
00050A            YEAR
     A

In Figure 29, fields from the physical file are concatenated into more than one field in the logical file.

Figure 29. Specifying the CONCAT Keyword (Example 3)

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RECORD3                   PFILE(PF1)
00020A            DATE                      CONCAT(MTH DAY YEAR)
00030A            CMPDAT                    CONCAT(DAY MTH YEAR)
     A

In Figure 30, if the fields from PF1 are:

The resulting fields are:

Figure 30. Specifying the CONCAT Keyword (Example 4)

|...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8
00010A          R RECORD4                   PFILE(PF1)
00020A            FIELD1                    CONCAT(FIXED1 VARLEN1)
00030A            FIELD2                    CONCAT(FIXED1 FIXED2)
00040A            FIELD3                    CONCAT(FIXED1 FIXED2)
00050A                                      VARLEN
     A