The IFTRAIL parameter is used to identify an existing trailer record in the input data for an OUTFIL group and update any count or total fields in the record. This parameter is useful when an input file is being altered in the current application by adding or deleting records, or by modifying data fields used to produce count and total fields in the trailer record. Using IFTRAIL lets you update the count and total fields to reflect those changes. The updated count and total fields will reflect the input data to OUTFIL processing.
The trailer record is identified by using the TRLID subparameter, and the updates are specified in the TRLUPD subparameter. Since the trailer record is not a data record, no other OUTFIL processing, such as INCLUDE/OMIT or OUTREC parameter processing, will be performed on it. The trailer record will also not be used for the updated count or total values. You may optionally identify the first record passed to the OUTFIL group as a header record by using the HD=YES parameter. A header record will similarly not be subject to other OUTFIL processing, nor will it be used for the updated count or total values in the trailer record.
IFTRAIL may not be used with any of the following OUTFIL operands: HEADERn, TRAILERn, SECTIONS, CONVERT, VTOF, FTOV, LINES, NODETAIL, REPEAT, SPLIT, SPLITBY, SPLIT1R, VLFILL, VLTRAIL, or VLTRIM.
TRLID=(cond)
The TRLID subparameter specifies the condition that is used to identify the trailer record in the input data to an OUTFIL group. The condition is specified in the same manner as for the OUTFIL INCLUDE parameter, which is based on the INCLUDE/OMIT control statements. For example,TRLID=(10,6,CH,EQ,C'TOTAL:'). Note that locale processing is not used for TRLID.
The first record into the OUTFIL group for which the condition is true is determined to be the trailer record and thus end-of-file. All succeeding records will be ignored for the OUTFIL group.
For variable length records, the VLTESTI installation parameter and EXEC statement parameter does not apply. Records that do not contain all TRLID fields will bypass TRLID processing.
TRLUPD=(field1[,field2]...)
TRLUPD is used to specify the count and toral fields to be updated in the trailer record. Each field consists of an optional column number (c:) followed by a COUNT[{+,-}nnn]= or TOTAL/TOT= subparameter like those used in the TRAILERn parameters. See TOTAL/TOT and COUNT[{+,-}nnn]=. For example,TRLUPD=(5:COUNT=(EDIT=(IITTT)),21:TOT=23,4,ZD,M1,LENGTH=6)).
The fields should not overlap the RDW in columns 1-4 for variable length records, and they should not extend past the end of the trailer records or they will not be included in the record. For fixed length records, the trailer record will be truncated or padded with blanks to match the output file record length as necessary. If a column number is not specified, the field will begin in column 1 or directly after the previous field. Fields should not overlay each other and should be specified in ascending column order.
The values used for the COUNT and TOTAL fields derive from the original OUTFIL group input records and do not include the trailer record itself.
HD=YES
HD=YES is used to identify the first OUTFIL group input record as a header record. Normal OUTFIL processing for parameters such as INCLUDE or OUTREC will not be applied to the header record, and the record will not be used to determine COUNT and TOTAL values for the trailer record, if one is found. TRLID processing will not apply to the header record.