Sample Dictionary Statements - 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
Copyright
2024
First publish date
2010
Last updated
2024-11-06
Published on
2024-11-06T17:38:26.716054

This section provides some examples of dictionary statements and their usage.

Example 1

Figure 1. Sample Dictionary Statements

This example uses leading blanks before some color dictionary_names to create indentation for clarity.

A blank statement is used before and after the "color" section. Such blank statements are ignored but can be printed.

Dictionary_names are case-sensitive. Thus, Red and red are separate dictionary_names.

Example 2

Figure 2. Example of Use of Asterisk to Replace Position (p)

In this example, note how position (p) is replaced with an asterisk (*) to indicate that the value of p should be the next position after the previous field. This is a powerful feature. Using an asterisk (*) for position allows you to define adjoining fields automatically. Thus, if a field specification changes, it is not necessary to calculate and specify the changed positions of subsequent fields.

Example 3

Figure 3. Example of Use of SKIP Operator

In this example, the SKIP operator advances the next position by n bytes. Since the position of the next field is specified with an asterisk (*), the position will be calculated automatically.

Example 4

Figure 4. Example of Use of Equal Sign to Replace p,l, or f

In this example, an equal sign (=) is used instead of p, l or f. The equal sign assigns the previous position, length or format to the equal sign, mapping one field onto another.

Although field_names and constant_names can usually be specified in any order, using the asterisk (*) or equal sign (=) forces a dependency on field order.

Note the use of comments in the above examples. As for MFX control statements, a blank after the value indicates the beginning of a comment. You can also use comment statements, which begin with an asterisk (*) in column 1.

Example 5

Figure 5. Sample SYMNAMES DD Statement

This example uses concatenated dictionaries. Suppose the dictionaries contain field_name statements as follows:
Figure 6. Sample field_name Statements in Dictionaries

MFX will print the following dictionary table:
Figure 7. Sample Dictionary Table

Field_names from all three dictionaries in the above example could be used in MFX control statements as follows:
Figure 8. Sample field_names in Control Statements

Example 6

This example demonstrates some circumstances where format specifications are used and are not used in control statements.

In your symbols dictionary 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 under certain circumstances. For example, consider the following dictionary statements:

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

Suppose you use these field_names in the following control statements:

Figure 10. 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' and 'CheckDate' is replaced with '17,6,Y2T'.

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

  • In the OUTFIL statement, 'Account#' is replaced with '1,12', 'CheckDate' is replaced with '17,6,Y2T' because of the special nature of the Y2T format, and 'CheckAmount' is replaced with '23,6,PD' because it is followed by an EDIT mask.

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