Starting ZDT/Db2 functions from an external application

You can use the ZDT/Db2 exec HFM2INEX to start a Z Data Tools/Db2 function from an external application such as a REXX exec or CLIST.

HFM2INEX is distributed in HFM.SHFMEXEC. When using this interface you need to ensure the following:
  • The Z Data Tools libraries must be allocated before calling HFM2INEX.
  • If you use LIBDEFs and ALTLIB statements to allocate the Z Data Tools libraries, invoke HFM2INEX using the following command:
    "SELECT MODE(FSCR) CMD(%HFM2INEX "parms") NEWAPPL(HFM2) PASSLIB SUSPEND"
    This will ensure that the Z Data Tools libraries are available to HFM2INEX.

The parameters that can be passed to HFM2INEX are shown in Parameters for HFM2INEX.

The function codes that can be specified are shown in Function codes for HFM2INEX.

For example, referring to Parameters for HFM2INEX and Function codes for HFM2INEX, you might build the following parameter string:
SSID(DFE2) OW(DSN81210) NM(EMP) F(4.5)
In this case your select statement would be:
"SELECT MODE(FSCR) CMD(%HFM2INEX SSID(DFE2) OW(DSN81210) NM(EMP) F(4.5)),
NEWAPPL(HFM2) PASSLIB SUSPEND"
Table 1. Parameters for HFM2INEX
Parameter Description
SSID The Db2® subsystem (or data sharing group) ID that ZDT/Db2 should connect to.
OW The owner (creator) of a Db2® object that ZDT/Db2 should access.

The owner is only passed if the function will accept an owner. Owner values are not passed to menu panels, or any option panel. See Function codes for HFM2INEX for additional exceptions.

NM The name of a Db2® object that ZDT/Db2 should access.

The name is only passed if the function will accept a name. Name values are not passed to menu panels, or any option panel. See Function codes for HFM2INEX for additional exceptions.

F
  • A code that indicates which ZDT/Db2 function should be executed. The code corresponds to the ZDT/Db2 main menu option used to select the desired function (eg 3.6 for import).
  • For editor functions only, if the function code has 'O' as a suffix, the editor function entry panel will be displayed.
  • For editor functions without the 'O' suffix, the first data displayed will be the data for the specified Db2® object.
Table 2. Function codes for HFM2INEX
Function code Description
B ZDT/Db2 Browse function. First panel displayed shows data for the specified Db2® object.
BO As for B, except the editor function entry panel is the first panel displayed.
1 ZDT/Db2 View function. First panel displayed shows data for the specified Db2® object.
1O As for 1, except the editor function entry panel is the first panel displayed.
2 ZDT/Db2 Edit function. First panel displayed shows data for the specified Db2® object.
2O As for 1, except the editor function entry panel is the first panel displayed.
3 Displays the ZDT/Db2 Utilities menu.
3.1 ZDT/Db2 Print function. First panel displayed is the print function entry panel.
3.2 Z Data Tools Object functions. First panel displayed is the Object Functions function entry panel. Any owner or name values are NOT passed.
3.3 ZDT/Db2 Copy function. First panel displayed is the copy (from) function entry panel.
3.4 Z Data Tools Object List function. First panel displayed in the Object List function entry panel.
3.5 Z Data Tools Object Privileges function. First panel displayed in the Object Privileges function entry panel.
3.6 ZDT/Db2 Import function. First panel displayed is the import (from) function entry panel.
3.7 ZDT/Db2 Export function. First panel displayed is the export function entry panel.
3.8 ZDT/Db2 Data Create function. First panel displayed is the data create function entry panel.
3.9 ZDT/Db2 Utilities function. First panel displayed is the Db2® utilities function entry panel. Any owner or name values are NOT passed.
3.10 ZDT/Db2 Audit Log function. First panel displayed is the audit log function entry panel. Any owner or name values are NOT passed.
4 Displays the ZDT/Db2 SQL Prototyping, Execution and Analysis menu.
4.1 Z Data Tools Basic SQL Prototyping function. First panel displayed is the basic SQL prototyping function entry panel.
4.2 Z Data Tools Advanced SQL Prototyping function. First panel displayed is the advanced SQL prototyping function entry panel. Any owner or name values are NOT passed.
4.3 Z Data Tools "Enter, Execute and Explain SQL Statements" function. First panel displayed is the "Enter, Execute and Explain SQL Statements" function entry panel. Any owner or name values are NOT passed.
4.4 Z Data Tools "Edit and Execute SQL Statements from a Data Set" function. First panel displayed is the "Edit and Execute SQL Statements from a Data Set" function entry panel. Any owner or name values are NOT passed.
4.5 Z Data Tools Explain Utilities function. First panel displayed is the explain utilities function entry panel. Any owner or name values are NOT passed.
6 Z Data Tools Enter and Execute Db2® Commands function. First panel displayed in the enter and execute Db2® commands function entry panel. Any owner or name values are NOT passed.
0 Displays the ZDT/Db2 Options menu.
0.0 Displays the ZDT/Db2 System Options menu.
0.0.1 Displays the ZDT/Db2 Print Settings panel.
0.0.2 Displays the first ZDT/Db2 Systems Options panel.
0.0.3 Displays the ZDT/Db2 Batch Job Card information panel.
0.0.4 Displays the ZDT/Db2 Compiler Language selection panel.
0.0.5 Displays the ZDT/Db2 COBOL Processing Options panel.
0.0.6 Displays the ZDT/Db2 HLASM Processing Options panel.
0.0.7 Displays the ZDT/Db2 PL/I Processing Options panel.
0.0.8 Displays the ZDT/Db2 Temporary Data Set Allocations panel.
0.0.9 Displays the ZDT/Db2 Output Data Set Allocation Options panel.
0.0.10 Displays the ZDT/Db2 Trace Options panel.
0.1 (0.2) Displays the first ZDT/Db2 Editor options panel.
0.3 Displays the ZDT/Db2 Utility Processing Options panel.
0.3.1 Displays the ZDT/Db2 Print Utility Options panel.
0.3.3 Displays the ZDT/Db2 Copy Utility Options panel.
0.3.4 Displays the ZDT/Db2 Object list utility options panel.
0.3.7 Displays the ZDT/Db2 Export utility options panel.
0.3.L Displays the ZDT/Db2 Db2® LOAD utility options panel.
0.3.UL Displays the ZDT/Db2 Db2® Utility LISTDEF options panel.
0.3.UO Displays the ZDT/Db2 Db2® Utility OPTIONS options panel.
0.3.UT Displays the ZDT/Db2 Db2® Utility TEMPLATE options panel.
0.3.UU Displays the ZDT/Db2 Db2® Unload utility options panel.
When a Z Data Tools/Db2 function is started using HFM2INEX, the following restrictions apply:
  • You cannot issue a command to change the currently connected Db2® system.
  • The SQLID used when ZDT/Db2 is started is the same as the users TSO logon ID, unless modified by a Db2® authorization exit.
  • Exiting the first panel displayed by the HFM2INEX invocation returns to the caller. It is not possible to navigate to other parts of Z Data Tools. You can however use the pull-down options to perform ZDT/Db2 functions.

These restrictions do not apply when no option code is specified for the HFM2INEX invocation.

Only the function codes listed in Function codes for HFM2INEX are supported. Any attempt to use any other code will result in the primary ZDT/Db2 menu being displayed; the erroneous function code will be discarded.