Using JCL SET and PROC Symbols to Create Dictionary_Names - 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

There is another way to establish dictionary_names directly in JCL statements rather than in a SYMNAMES data set. For JCL-initiated MFX applications only, the data from JCL SET and PROC symbols can be used together with the MFX JPn PARM options to create character string dictionary_names. Text strings and system symbols can also be used. These JPn dictionary_names can then be used in MFX control statements in the same manner as the SYMNAMES dictionary_names. The ability to alter JCL to dynamically change control statements that are often contained in data sets can be very useful.

On the EXEC statement, specify PARM='…,JPn''string'',…' where n is from 0 to 9. The quotes delimit the start and end of the string, so the string should not contain any imbedded quotes. If  apostrophes are required, two should be specified for each one so as not to terminate the PARM field. Up to 10 such JPn PARMs can be used in one PARM field.

The string may contain any combination of

  • SET or PROC symbols from the JCL. These are prefaced by an ampersand: &symbol

  • System symbols, which are also prefaced by an ampersand, such as &JOBNAME or &YYMMDD

  • Any characters except quotes; characters after a symbol name may be appended with a period: &symbol.text

JPn dictionary_names are listed in the optional SYMNAMES DD output data set before any other dictionary_names that have been defined in the SYMNAMES DD data set. They will be built as
Figure 1. JPn format in SYMNAMES DD

Example 1     Using JCL SET symbols

Select data for only certain states where the list of states will vary:
Figure 2. Example of using JCL SET symbols

After data dictionary symbol substitution, the INCLUDE statement becomes
Figure 3. Using JCL SET symbols

The output is
Figure 4. Using JCL SET symbols

Example 2    Using system symbols

Select data for the current month using system symbols for MM and YYYY:
Figure 5. Example of using system symbols

Assuming this JCL was executed in July 2013, after data dictionary symbol substitution the INCLUDE statement becomes
Figure 6. Using system symbols

The output would be
Figure 7. Using system symbols

Example 3    Using PROC symbols and text

Produce a report for one particular month, which is selectable from the EXEC statement for a PROC:
Figure 8. Example of using PROC symbols and text

After data dictionary symbol substitution, the OUTFIL statement becomes
Figure 9. Using PROC symbols and text

The report is produced for the selected month only:
Figure 10. Using PROC symbols and text