The Field_name Statement: Rules and Syntax - 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 format of the field_name statement is illustrated below.

Figure 1. Field_name Statement Format

A field_name in a dictionary statement can be defined by its position in the record and its length and format type (p,l,f). Length and format type are optional. A field_name can also refer to a parsed field (%pp).

The rules for fields specified in a control statement always apply to a field specified as a dictionary_name since internally MFX substitutes the actual field specification. For example, if you specify a format, take care that the format of the field_name is acceptable on the MFX control statement. For example, consider the dictionary_name CITY, defined by the following dictionary statement:

Figure 2. Example of field_name in Dictionary Statement

The following control statement specifying CITY would be valid because a CH field is permissible on the SORT control statement:
Figure 3. Example of field_name in Control Statement

However, the field_name CITY could not be used on a DUPKEYS AVG control statement because CH is not a valid format with AVG.

Note that you can specify a field_name with p, l, and f, then use the field_name in a control statement that only requires p and l. MFX will substitute p and l during processing and ignore the f specification. For example, consider the following dictionary statements:

Figure 4. Example of p,l,f in Dictionary Statements

Suppose you use these field_names in the following control statements:

Figure 5. Example of field_names in Control Statements

Based on the field_names defined in the dictionary statements, MFX will make the following substitutions:

  • In the SORT statement, 'Account#' is replaced with '1,12,CH'.

  • In the DUPKEYS statement, 'CheckAmount' is replaced with '23,6'.

Here are the resulting control statements:
Figure 6. Example of p,l in Control Statements

For more information on format substitution, refer to the Using Dictionary_names in MFX Control Statements.

The following three subsections describe the rules for specifying position (p), length (l) and format (f) in field_name dictionary statements.