Preparing and sending SQL files


Use the following guidelines when preparing and sending SQL files that BMC AMI Log Master for Db2 generates on the mainframe to a Windows or Unix platform for execution by High-speed Apply Engine.

  • Define the SQL output data set as VB if the generated SQL statements cannot exceed 27 KB in length. For example:

     SQL MIGRATE
    DATASET MY.MIGRATE.SQL NEW CYLINDERS SPACE(50,20) UNIT(SYSDA) RELEASE RECFM VB
  • If minimizing the elapsed time for the file transmission is important, consider not generating and sending a template file. Using the template file increases the SQL file size by 25 percent or more, which affects transmission time and DASD space usage. If High-speed Apply Engine does not use a template file, some SQL will be executed in dynamic mode before binds occur that allow execution in static mode.
  • If you are using File Transfer Protocol (FTP), include the following command to ensure that trailing blanks are removed:

    quote site trail
  • If you are using FTP to send the SQL file to a Windows server, include the following command to ensure that High-speed Apply Engine recognizes the end-of-line character:

    quote site sbsendeol=lf
  • After sending the file, ensure that all characters were translated correctly from EBCDIC to ASCII. You might need to adjust the translate tables used in the data transfer.
  • If the SQL output was generated with RECFM set to FB (the default), include the SQL parameter Format with a value of Packed72 in the High-speed Apply Engine configuration file, as shown in the following example:

    [SQL]
      Format=Packed72

For more information about the Format parameter, see Format.

File transfer examples

The following figure shows sample JCL for running FTP in batch mode on the mainframe:

//FTP EXEC PGM=FTP,REGION=0M
//OUTPUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//OUTPUT DD SYSOUT=*
//INPUT DD *
yourServerName
yourLoginID
yourPassword
cd yourdirectory
quote site trail
quote site sbsendeol=lf
put 'your.mainframe.migr.sql.dataset' yourlocalfile.sql
quit
/*

The following figure shows an example FTP session on a Windows or UNIX platform. In the example, bold text indicates user entries.

 C:/ftptest>ftp themainframe
Connected to themainframe.xyz.com.
220-FTPDN1 IBM FTP CS V1R9 at themainframe.xyz.com, 22:08:29 on 2009-01-16.
220 Connection will close if idle for more than 30 minutes.
User (themainframe.xyz.com:(none)): mylogin
331 Send password please.
Password:
230 MYLOGIN is logged on. Working directory is 'MYLOGIN.'.
ftp> quote site trail
200 SITE command was accepted
ftp> quote site sbsendeol=lf
200 SITE command was accepted
ftp> get
Remote file 'MYLOGIN.MIGRATE.SQL'
Local file mylocalfile.sql
200 Port request OK.
125 Sending data set MYLOGIN.MIGRATE.SQL
250 Transfer completed successfully.
ftp: 15911243 bytes received in 1.90Seconds 8392.01Kbytes/sec.
ftp>

 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*