HEADER1/HEADER2 Parameters (Optional) - mfx - 3.1

Syncsort™ MFX Programmers Guide

Product type
Software
Portfolio
Integrate
Product family
Syncsort™ Software
Product
Syncsort™ MFX > MFX
Version
3.1
Language
English
Content type
Programmer’s Guide
Product name
Syncsort™ MFX
Title
Syncsort™ MFX Programmers Guide
Topic type
How Do I
Copyright
2024
First publish date
2010
Last edition
2024-08-27
Last publish date
2024-08-27T08:14:56.318001

The SortWriter facility provides three types of headers:

  • HEADER1, the report header

  • HEADER2, the page header

  • HEADER3, the section header.

HEADER1 and HEADER2 are parameters of the OUTFIL control statement. HEADER3 is a subparameter of OUTFIL’s SECTIONS parameter. Refer to SECTIONS Parameter (Optional) for an explanation of how to specify HEADER3.

The three types of headers function independently of each other. Each serves a different purpose.

  • HEADER1 provides a header or a possible title page for the entire report. It appears only once at the beginning of the report on its own page.

  • HEADER2 provides a page header or a running head for each page defined by the LINES parameter. It appears at the beginning or top of each page.

  • HEADER3 provides a section header that appears at the beginning of each specified section and, optionally, at the top of each page (or directly below any HEADER2).

The chart below illustrates the format for HEADERs. The field entries represent the subparameters that can be specified for each HEADER entry.
Figure 1. HEADER Parameter Format

The following HEADER Subparameters Format chart illustrates and defines the available subparameters. Each subparameter constitutes a separate field of the HEADER.
Figure 2. HEADER Subparameters Format

c: Use the c: subparameter to define the column in which the specified field should begin. The c: value will ignore the carriage control character and, for variable-length records, the RDW. EBCDIC blanks will precede the specified column when needed.
n

Used in conjunction with the X, X'hh..hh', 'literal string', and / subparameters, the n value defines the number (1-4095) of occurrences for each entry.

X

Use the X subparameter to define the number of spaces. It must be coded to the immediate right of the n value, if specified. For more than 4095 spaces, two or more nX values should be specified.

X'hhhh...hh' Use the X'hhhh...hh' entry to specify that a hexadecimal string should be inserted in the header. (Each hh pair is 1 byte of output.) Specify the number of occurrences by coding n immediately before it.
'literal string' Use the 'literal string' subparameter to define a literal string. Specify the number of occurrences by coding n immediately before it. An apostrophe within a literal string must be specified as a double apostrophe; for example, – 'O"Leary'. 
/

Use the / subparameter to indicate the end of a line, force a carriage return, and separate text lines of a header. Multiple slashes (//.../ or n/) can be used to specify leading, trailing, or embedded blank lines. At the beginning or end of a header, n/ produces n blank lines. Within a header, n/ produces n-1 blank lines.

p,l

Use the p and l subparameters to include a field (or fields) within a record in the header. For a HEADER1, the field(s) will be extracted from the first record in a file; for a HEADER2, the field(s) will be extracted from the first record on a page; for a HEADER3, the field(s) will be extracted from the first record in a section. p is the starting position of the field in the record; l is the length in bytes (1-32752) of the field. Any number of fields can be specified. (Contiguous fields within a record can be specified with a single p,l entry, but their combined length cannot exceed 32752 bytes.) The specified field(s) should be a character or alphanumeric string or a number in printable format, and the field(s) cannot be converted or edited.

&DATE [{±}nnnn]

The &DATE subparameter specifies the current system date or date with offset and requires 8 bytes to display mm/dd/yy.

Optionally, you can create an offset of the current date. The offset takes the form {±}nnnn, where '+' indicates a date after the current date and '–' indicates a date before the current date. 'nnnn' is the date offset. The range is 0 to 9999, which represents the number of days to be added or subtracted from the current date.

&DATE=(m1m2m3m4)[{±}nnnn]

This form of the &DATE subparameter generates the cur­rent system date or date with offset and controls the formatting of the date. You can specify the position of the year, month, and day, specify a separator character, and choose between 2-digit and 4-digit year representation.

The positions m1 through m4 represent masks used to format the date. To specify the position of the month, day, and year, replace the m1, m2, and m3 positions, in any order, with M for the month (01-12), D for the day (01-31), and either Y or 4 for the year (where Y is a 2-digit year and 4 is a 4-digit year). Replace the m4 position with a separator character.

For example, to print the date with the form yy-mm-dd, specify &DATE=(YMD-). For December 31, 1999, the date would appear as “99-12-31.”

The field for this form of &DATE requires 8 bytes for a 2-digit year representation and 10 bytes for a 4-digit year. The M, D, and Y or 4 may only appear once in the mask. All four positions must be specified.

Optionally, you can create an offset of the current date. See &DATE [{±}nnnn] for a description.

&DATENS=(xyz)[{±}nnnn]

This form of the &DATENS subparameter specifies that the cur­rent date or date with offset is to appear in the report record in the form 'xyz', where x, y, and z indicate the order in which the month, day, and year are to appear and whether the year is to appear as two or four digits. For x, y, and z, use M to represent the month (01-12), D to represent the day (01-31), Y to represent the last two digits of the year (for example, 02), or 4 to represent the four digits of the year (for example, 2002). M, D, and Y or 4 can each be specified only once.

For example, &DATENS=(DMY) would produce a date of the form 'ddmmyy' which on March 29, 2002, would appear as '290302'. &DATENS=(4MD) would produce a date of the form 'yyyymmdd' which on March 29, 2002, would appear as '20020329'. x, y, and z must be specified.

Optionally, you can create an offset of the current date. See &DATE [{±}nnnn] for a description.

&YDDD=(m1m2m3)[{±}nnnn]

This form of the &YDDD subparameter specifies that the cur­rent date or date with offset is to appear in the report record in the form of a year and day. You can specify the position of the year and day, specify a separator character, and choose between 2-digit and 4-digit year representation. The positions m1 through m3 represent masks used to format the date. To specify the position of the year and day, replace the m1 and m2 positions (in either position) with D for day (001-366) and either Y or 4 for the year (where Y is a 2-digit year and 4 is a 4-digit year). Replace the m3 position with a separator character.

For example, to print the date in the form yyyy/ddd, specify &YDDD=(4D/). For March 29, 2005, the date would appear as 2005/088.

Optionally, you can create an offset of the current date. See &DATE [{±}nnnn] for a description.

&YDDDNS=(m1m2)[{±}nnnn]

This form of the &YDDDNS subparameter specifies that the current date or date with offset is to appear in the report record in the form of a year and day. You can specify the position of the year and day and choose between 2-digit and 4-digit year representation. The positions m1 and m2 represent masks used to format the date. To specify the position of the year and day, replace the m1 and m2 posi­tions (in either position) with D for day (001-366) and either Y or 4 for the year (where Y is a 2-digit year and 4 is a 4-digit year).

For example, to print the date in the form dddyy, specify &YDDDNS=(DY). For March 29, 2005, the date would appear as 08805.

Optionally, you can create an offset of the current date. See &DATE [{±}nnnn] for a description.

&TIME 

The &TIME subparameter specifies the current time of day and requires 8 bytes to display hh:mm:ss, where hh is in 24-hour format.

&TIME=(hp)

This form of the &TIME subparameter generates the current system time of day and controls the formatting of the time. You can print the time in 24-hour or 12-hour format and specify the separator character between the hours, minutes, and seconds.

The format for 24-hour time is hhpmmpss, where hh represents the hour (00-23), mm represents minutes (00-59), ss represents seconds (00-59), and p represents the separator character as specified by p in the &TIME=hp subparameter.

The format for 12-hour time is hhpmmpss nn, where hh represents the hour (01-12), mm represents minutes (00-59), ss represents seconds (00-59), and p represents the separator character as specified by p in the &TIME=hp subparameter. The nn is “am” or “pm” as appropri­ate.

To select 12-hour mode specify h as 12; to select 24-hour mode spec­ify h as 24. The p specification represents the character to use as a separator. For example, to display the time in a 12-hour format with a period as a separator, specify &TIME=(12.). At 22:43:23 hours, the time would appear as “10.43.23 pm.”

The field for this form of the &TIME subparameter requires 8 bytes for the 24-hour format and 11 bytes for the 12-hour format.

&TIMENS=(tt)

This form of the &TIMENS subparameter specifies that the current time is to appear in the report record in the form 'hhmmss' (24-hour time) or 'hhmmss xx' (12-hour time). If tt is 24, the time is to appear in the form 'hhmmss' (24-hour time) where hh represents the hour (00-23), mm represents the minutes (00-59), and ss represents the seconds (00-59).

For example, &TIMENS=(24) would produce a time of the form 'hhmmss' which at 08:25:13 pm would appear as '202513'. If tt is 12, the time is to appear in the form 'hhmmss xx' (12-hour time) where hh represents the hour (01-12), mm represents the minutes (00-59), ss represents the seconds (00-59), and xx is either 'am' or 'pm'. For a second example, &TIMENS=(12) would produce a time of the form 'hhmmss xx' which at 08:25:13 pm would appear as '082513 pm'.

&PAGE 

The &PAGE subparameter sequentially numbers logical pages of the output report and requires 6 bytes. It produces a 6-digit sequential page number, right justified with leading zeros suppressed. &PAGE is ignored for HEADER1.

&PAGE=(…)

This form is similar to the &PAGE subparameter except that a 15-digit page number will be provided for display with editing or conversion to another data format.

The following describes the &PAGE subparameters that control for­mat conversion or printable display with edit:
fo
Use this subparameter to define the output
TO=fo

numeric data format of an expression. When fo is specified, mask Mm, EDIT, and SIGNS cannot be specified. Indicate the desired format of the output field by replacing fo with BI, CSF/FS, FD, FI, PD, or ZD. See How to Con­vert Numeric Data for the default lengths of these fields. See LENGTH=n Subparameter for how this default may be changed. 

TO=fo is equivalent to fo and in general, there is no reason to use the TO= form. However, if you are using a data dictionary symbol in your control statement, you should use the TO=fo form to avoid ambiguities with certain types of data conversions. See the sectionINREC, OUTREC, OUTFIL TO Subparameter.

Mm

Use the Mm subparameter to indicate that one of the 27 MFX-provided editing masks, M0-M26, is to be used. Replace 'm' with the mask number. For details, see Mm Subpa­rameter (Editing Masks).

EDIT=(pattern)
Use the EDIT subparameter to specify that a user-provided editing mask should be used to format the output fields. For details, see EDIT Subparameter.
SIGNS=(s1,s2,s3,s4)
Use the SIGNS subparameter to specify the signs that will appear before or after the edited number. For details, see SIGNS Subparameter.
LENGTH=n
Use the LENGTH subparameter to alter the length of the output field. This is normally determined by the number of numeric digits and either the data format or the edit pattern and format of the edited field. For details, see LENGTH=n Subparameter.