If you work with Toad for DB2 on your DB2 subsystem, it happens quite often that your work results in a DDL or DML script in the editor. It can’t be executed directly but needs to be scheduled for running in the night. Now you have the challenge to transfer it to your mainframe.
No worries, if you use Toad you can easily transfer your script into a PDS member. Before you can start, please ensure this: On each DB2 for z/OS subsystem on which you want to execute remote scripts via Toad, you must have both the Toad IBM DB2 z/OS component and the SYSPROC.DSNUTILU procedure installed. For information about installing the z/OS component, see the Toad IBM DB2 z/OS Component Installation Guide.
If this is done, simply follow these steps:
- Connect to a DB2 subsystem with Toad
- Open your SQL script into the editor of Toad. Our example is a very simple select query.
- Open the “Editor” pull-down menu and select “Remote job Execution”:
- The Remote Script Execution Wizard of Toad appears. You are asked to select the target DB2 subsystem, User-ID and password, which is used to connect to it.
- Review the job card:
A default job-card can be specified under Tools/Options in Toad:
- Review the whole JCL. This text will be taken and written into the specified PDS member on the host. You can edit here if necessary.
- Select the target partitioned data set to which you want to save your script either via typing it directly or filter and query it and specify the name of the PDS member:
Easily query a PDS on your host:
- Select the transfer protocol (you can choose between FTP and SFTP) and click next. The server address is the IP address of the DB2 subsystem on the mainframe.
- The result: You have transferred your script into a PDS member.