Purpose
The NOTIFY command specifies a user exit or predefined action to be performed whenever certain significant events occur during a Teradata FastLoad job. (For a listing of events that cause notifications, see Table 40 on page 137.)
The notify function is especially useful in operator‑free environments where job scheduling relies heavily on automation to optimize system performance. For example, by writing an exit in C (without using CLIv2) and using the NOTIFY… EXIT option, a routine to detect whether a Teradata FastLoad job succeeds or fails, how many records were loaded, what the return code was for a failed job, and so on can be provided.
Note: The Teradata FastLoad NOTIFY command applies only to the job that immediately follows it.
Syntax
where
Syntax Element |
Description |
OFF |
Default. No notification of events is to be provided. |
LOW |
Notification is to be provided for those events signified by “Yes” in the Low Notification Level column of Table 40. |
MEDIUM |
Notification is to be provided for those events signified by “Yes” in the Medium Notification Level column of Table 40. |
HIGH |
Notification is to be provided for those events signified by “Yes” in the High Notification Level column of Table 40. |
EXIT |
A user‑written exit is to be called at the appropriate time. |
name |
The name of a user‑supplied library with an entry point named The default library names are: |
TEXT "string" |
A user‑supplied string of up to 80 characters that Teradata FastLoad passes to the named exit routine The string specification must be enclosed in double‑quote characters ("). |
MSG "string" |
A user‑supplied string of up to 16 characters that Teradata FastLoad logs on to: The string specification must be enclosed in double quote characters. This service is not available on Windows 98. |
QUEUE |
Specifies that a queue is to be manipulated via ENQ or DEQ See Table 41 for more details. This option is valid only for z/OS. |
option |
One of the following: RNAME defines a quoted string of up to 255 characters. The default is TRDUSER. SCOPE defines one of the following: NOBLOCK specifies that if the ENQ blocks for any reason, it must return an error instead. This is a fatal error for the job. The default, an implied BLOCK (there is no BLOCK keyword), means that the ENQ will wait for the QUEUE. |
EXIT64 |
A user‑written exit is to be called at the appropriate time. |
EXITEON |
A user-written exit is to be called at the appropriate time. |
Table 40 lists events that create notification.
Event |
Notification Level |
Signifies |
||
Low |
Medium |
High |
||
Initialize |
Yes |
Yes |
Yes |
Successful processing of the NOTIFY command |
File or INMOD open |
No |
No |
Yes |
Successful processing of the DEFINE command |
Phase 1 begin |
No |
Yes |
Yes |
Beginning of the insert phase, as specified by the INSERT statement |
Checkpoint |
No |
No |
Yes |
Checkpoint information has been written to the restart log table |
Phase 1 end |
No |
Yes |
Yes |
Successful processing of the CHECKPOINT LOADING END request after the end of the insert phase |
Phase 2 begin |
No |
Yes |
Yes |
The END LOADING command is about to be sent to the Teradata Database |
Phase 2 end |
No |
Yes |
Yes |
Successful processing of the END LOADING command |
Error table 1 |
No |
No |
Yes |
Successful processing of the SEL COUNT(*) request for the first error table |
Error table 2 |
No |
No |
Yes |
Successful processing of the SEL COUNT(*) request for the second error table |
Teradata Database Restart |
No |
Yes |
Yes |
A crash error from the Teradata Database or the CLIv2 |
CLIv2 error |
Yes |
Yes |
Yes |
A CLIv2 error |
Teradata Database error |
Yes |
Yes |
Yes |
A Teradata Database error that will terminate Teradata FastLoad |
Exit |
Yes |
Yes |
Yes |
Teradata FastLoad is terminating |
Usage Notes
Table 41 describes the things to consider when using the NOTIFY command.
Topic |
Usage Notes |
QUEUE Notes |
When QUEUE with LOW option is specified, the following takes place: 1 When NOTIFY is processed, it performs an ENQ upon a QUEUE with RNAME of ‘TRDUSER’ and a scope of ‘JOB’. This call blocks until it acquires the QUEUE. 2 After the job gets the QUEUE, it continues until it reaches a specific point (such as the request completes) when it releases the QUEUE by performing a DEQ. |
Error Handling |
When an error occurs, NOTIFY behaves as follows: |
Restarts |
The following points pertain to restarts related to NOTIFY: |
Creating Exit Routine |
When creating an exit routine, the following general procedures are constant across all operating systems: Note: For a definition of the variable record structure, see “Notify Exit Routine Example” on page 204. long _dynamn(FLNotifyExitParm *P)
The procedures for creating and using an exit routine are the same as for creating and using an INMOD routine, as described in “INMOD and Notify Exit Routines” on page 61 and Appendix D: “Compile, Link, and Execute INMOD and Notify Exit Routines.” |