Sample configuration of stored procedures for DB2

Use the following guidelines when you configure stored procedures for the DB2® database.

Guidelines for configuring stored procedures

  • The database must be DB2® version 9.7.8 or higher.
  • Create new jobs in DB2® Administrative Task Scheduler (ATS)
  • Schedule the jobs to run at least daily. You must schedule sp_runid to run at least 10 minutes before the other scripts.

Example for creating a run identifier

The following example shows how to get a job number every day at 20:50 hours without an end date.

call SYSPROC.ADMIN_TASK_ADD('RunID_Job',null,null,
null,'50 20 * * *','USER1','SP_RUNID',null,null,null)

Example for processing email contact data

The following example shows how to schedule a batch job to process contact data. In this example, the job runs at 21:00 hours every day. Schedule the job to run at least 10 minutes after the job that generates the run identifier.

call SYSPROC.ADMIN_TASK_ADD('Email_Contact_Job',null,null,null,'00 21 * * *',
'USER1','SP_POPULATE_MAILING_CONTACTS',null,null,null) 

Example for processing email response data

The following example shows how to schedule a batch job to process response data. In this example, the job runs at 21:00 hours every day. Schedule the job to run at least 10 minutes after the job that generates the run identifier.

call SYSPROC.ADMIN_TASK_ADD('Email_Response_Job',null,null,
null,'00 21 * * *','USER1','SP_POPULATE_MAILING_RESPONSES',null,
null,null) 

Example for processing SMS contact data

The following example shows how to schedule a batch job to process contact data. In this example, the job runs at 21:00 hours every day. Schedule the job to run at least 10 minutes after the job that generates the run identifier.

call SYSPROC.ADMIN_TASK_ADD(’SMS_Contact_Job’,null,null,null,’00 21 * * *’,
’USER1’,’SP_POPULATE_SMS_CONTACTS’,null,null,null) 

Example for processing SMS response data

The following example shows how to schedule a batch job to process response data. In this example, the job runs at 21:00 hours every day.

call SYSPROC.ADMIN_TASK_ADD(’SMS_Response_Job’,null,null,
null,’00 21 * * *’,’USER1’,’SP_POPULATE_SMS_RESPONSES’,null,
null,null)

Example for processing WhatsApp contact data

The following example shows how to schedule a batch job to process contact data. In this example, the job runs at 21:00 hours every day. Schedule the job to run at least 10 minutes after the job that generates the run identifier.

call SYSPROC.ADMIN_TASK_ADD(’WHTSAPP_Contact_Job’,null,null,null,’00 21 * * *’,
’USER1’,’SP_POPULATE_WHTSAPP_CONTACTS’,null,null,null) 

Example for processing WhatsApp response data

The following example shows how to schedule a batch job to process response data. In this example, the job runs at 21:00 hours every day.

call SYSPROC.ADMIN_TASK_ADD(’WhtsApp_Response_Job’,null,null,
null,’00 21 * * *’,’USER1’,’SP_POPULATE_WHTSAPP_RESPONSES’,null,
null,null)

Example for processing Mobile response data

The following example shows how to schedule a batch job to process response data. In this example, the job runs at 21:00 hours every day.

call SYSPROC.ADMIN_TASK_ADD(’Mobile_Response_Job’,null,null,
null,’00 21 * * *’,’USER1’,’SP_POPULATE_MOBILE_RESPONSES’,null,
null,null)