Please enable JavaScript to view this site.

Navigation: Technical Information

Notify API (NFYAPI)

Scroll Prev Top Next More

Overview

If you wish to perform a function dependent upon the status of a fax or e-mail being sent successfully or not from the Cobwebb queue then you can monitor the data queue NFYMSGQ.

If the data queue does not already exist in library CPPD then you can create it using the following command:

CRTDTAQ DTAQ(CPPD/NFYMSGQ) MAXLEN(29) TEXT('Notify Message Queue')

The response entry is added to data queue NFYMSGQ in the following format:

Position

Field

Description

1 - 6

TQREF

The Cobwebb Fax or EML Reference number

7 - 13

MSGID

The Cobwebb Fax or EML response message from message file QUSRMSG in library CPPD

FAX0059 = Fax Sent successfully

FAX0024 = Fax Failed to send

PPD0150 = E-mail Sent successfully

PPD0151 = E-mail Failed to send

14 - 21

USRID

User Id = NFYAPI

22 - 29

USRADR

User Address

The MSGID can be used to determine whether or not the message has been sent successfully and whether it was a fax or e-mail. The Cobwebb message reference number TQREF can be used to access the Cobwebb queue (AFAXQ in library CPPD) and complete details of the message retrieved.

To enable Cobwebb Fax and Cobwebb Email to write information to this data queue you need to specify the USERID in your CPPD output device as NFYAPI. (See below)

NFYAPI Fax parameters

NFYAPI Email parameters

Once the status of a message on the Cobwebb queue has changed to either ‘S’ for Sent or ‘W’ for Failed then a record will be written to the NFYMSGQ data queue. You can then write a program to monitor this data queue. A sample program has been provided in the file QUSRTOOL in library CPPD called NFYAPI.

Sample Program NFYAPI

This program monitors the data queue NFYMSGQ until Shutdown (the sub-system is ended). If a record is retrieved, the program checks the Message Id entry in the data queue (MSGID) and the Status of the message on the Cobwebb queue (TQSTS) and, if they agree, sends a message to message queue QSYSOPR.

To run this job in the CPPD subsystem you can call the following command:

SBMJOB CMD(CALL PGM(NFYAPI)) JOB(NFYAPI) JOBD(*LIBL/CPPD)