When IBM Facsimile Support/400 sends a Fax, it also sends a message to
the a queue specified by the FAXSNDDQ parameter on the Send Fax (SNDFAX)
command.
You can take the following code, and integrate it to your own programs.
When both programs are compiled you must use WRFAXVAL and change the
“Post sending User Exit pgm” (on page 4) : Please Note - This does only
apply for the Send Fax feature:
----------------------------------------------------------------------------
--------------
Communication User Exit Program
Dial User Exit Program . . . Name, F4=Prompt
Library . . . . . . . . . Name, *USRLIBL
Post sending User Exit pgm . MYPROG Name, F4=Prompt
Library . . . . . . . . . MYLIB Name, *USRLIBL
----------------------------------------------------------------------------
--------------
Also remember to create the data queue:
CRTDTAQ DTAQ(QGPL/SNDFAXDTAQ) MAXLEN(2000)
----------------------------------------------------------------------------
--------------
CL program MYPROG - Call it what ever you like and remember to change the
CALL stmt marked with red
/* ------------------------------------------------------------- */
/* Company . . . : Agent Data ApS */
/* Design . . . : Bent Ronne */
/* */
/* Sample of "Log Event User Exit Program". */
/* */
/* Sent an event to Data queue SNDFAXDTAQ */
/* ------------------------------------------------------------- */
pgm
/* Get the fax attr for the fax just processed */
RtvFaxA FaxSts(&Status) FaxStsTxt(&StsTxt) FaxRcpFaxN(&PFaxNo) +
FaxRcpEml(&EmailAdr) FaxRcpName(&RcpName) SndUsrPrf(&User) +
FaxMsgId(&PMSGID) FaxQDate(&PQDate_) FaxQTime(&PQTime_) +
FaxPagTrns(&PPGSNT) FaxMsgDta(&MSGDTA) FaxUsrKey(&UsrKey) +
FaxUsrDta(&UsrDta)
/* Convert date and time */
CvtDat Date(&PQDate_) ToVar(&PQDATE) FromFmt(*iso) ToFmt(*ymd)
ToSep(*None)
ChgVar &PqTime (%sst(&PqTime_ 1 2) !< +
%sst(&PqTime_ 4 2) !< +
%sst(&PqTime_ 7 2))
/* If sent OK or Error */
if ((&Status = &SndOk) +
*or (&Status = &SndErr)) Then(Do)
/* And loop throught All fax images in the list -
---------------------------------------------- */
RtvFaxLe (* *FIRST) &PSJOB &PSUSR &PSJBNO &PSFILE &PSNO_
NextEntry:
if (&PsJob ^= ' ') Do
ChgVar &PsNo &PsNo_
Call MYPGM2 Parm(&DQNAME &DQLIB &DQLEN &PSJOB &PSUSR &PSJBNO +
&PSFILE &PSNO &PFXNO &Status &PMSGID &PQDATE +
&PQTIME &PPGSNT &MSGDTA &USRKEY &USRDTA)
RtvFaxLe (* *Next) &PSJOB &PSUSR &PSJBNO &PSFILE &PSNO_
GoTo NextEntry
EndDo
EndDo
/* Program termination -
------------------- */
return
/* ----------------------------------------------------------------- */
/*
/* ----------------------------------------------------------------- */
Error:
SndPgmMsg MsgId(Cpf9898) MsgF(Qcpfmsg) MsgDta('User exit program error +
- See Previous listed message, in the job log, +
for more information') +
ToPgmQ(*Same) Msgtype(*Escape)
MonMsg Cpf0000
return
EndPgm
----------------------------------------------------------------------------
--------------
RPG program MYPGM2:
IIFAXDS DS 2000
* The qualified job name
* 10 - character job name
* 10 - character user name
* 6 - character job number
* 10 - character spooled file name
* 4 - character spooled file number
I 1 40 IJOB
I 1 10 ISJOB
I 11 20 ISUSR
I 21 26 ISJBNO
I 27 36 ISFILE
I 37 40 ISNO
* The telephone number
I 41 72 IFXNO
I I '00' 73 74 IMSGT
* S=successfull U=unsuccessfully
I I 'S' 75 75 ICMPST
* The Facsimile Support for OS/400 message identifier.
I 76 82 IMSGID
* The date of the data queue entry.
I 83 88 IQDATE
* The time of the data queue entry.
I 89 94 IQTIME
* The number of pages sent
I 95 990IPGSNT
* The duration of the telephone connection.
I 100 105 IDRTCN
* The name of the fax controller
I 106 113 ICTLD
* The name of the fax card or port used to send the fax
I 114 117 ICRDID
* The substitution text for the returned message identifier
I 118 373 IMSTXT
* The prefix for the telephone number.
I 374 383 INPRFX
* The direct connection type used to send the fax.
I 384 388 IDRCTP
* The option used to process the fax file sent.
I 389 389 IOPT
* The first user-defined field.
I 390 409 I1USRF
* The second user-defined field.
I 410 429 I2USRF
* Reserved.
I** 4302000 IRSV1
* ------------------------------------------------------------- *
* Parameter list *
* ------------------------------------------------------------- *
C *ENTRY PLIST
C PARM DQNAME 10
C PARM DQLIB 10
C PARM DQLEN
C PARM PSJOB 10
C PARM PSUSR 10
C PARM PSJBNO 6
C PARM PSFILE 10
C PARM PSNO 4
C PARM PFXNO 20
C PARM PSTS 30
C PARM PMSGID 7
C PARM PQDATE 6
C PARM PQTIME 6
C PARM PPGSNT 50
C PARM MSGDTA 50
C PARM USRKEY 20
C PARM USRDTA256
* ------------------------------------------------------------- *
* Map from RTVFAXA to IBM/400 data queues *
* ------------------------------------------------------------- *
C MOVELPSJOB ISJOB P
C MOVELPSUSR ISUSR P
C MOVELPSJBNO ISJBNO P
C MOVELPSFILE ISFILE P
C MOVELPSNO ISNO P
C MOVELPFXNO IFXNO P
C PSTS IFEQ 700 Sent OK
C MOVEL'S' ICMPST Successful
C ELSE
C MOVEL'U' ICMPST UnSuccessful
C ENDIF
* The Facsimile Support for OS/400 message identifier.
C MOVELPMSGID IMSGID
* The date of the data queue entry.
C MOVELPQDATE IQDATE
* The time of the data queue entry.
C MOVELPQTIME IQTIME
* The number of pages sent
C Z-ADDPPGSNT IPGSNT
* The duration of the telephone connection.
C MOVEL*BLANK IDRTCN n/a
* The name of the fax controller
C MOVEL*BLANK ICTLD n/a
* The name of the fax card or port used to send the fax
C MOVEL*BLANK ICRDID n/a
* The substitution text for the returned message identifier
C MOVELMSGDTA IMSTXT P
* The prefix for the telephone number.
C MOVEL*BLANK INPRFX n/a
* The direct connection type used to send the fax.
C MOVEL*BLANK IDRCTP n/a
* The option used to process the fax file sent.
C MOVEL*BLANK IOPT n/a
* The first user-defined field.
C MOVELUSRKEY I1USRF
* The second user-defined field.
C MOVELUSRDTA I2USRF
*
C EXSR EVENT
*
C RETRN
* ------------------------------------------------------------- *
* Send an event through the data queue
* ------------------------------------------------------------- *
C EVENT BEGSR
C CALL 'QSNDDTAQ' 8080
C PARM DQNAME 10
C PARM DQLIB 10
C PARM DQLEN 50
C PARM IFAXDS
C ENDSR
Re: Is there an easy way to replace IBM Facsimile Support/400?
When IBM Facsimile Support/400 sends a Fax, it also sends a message to
the a queue specified by the FAXSNDDQ parameter on the Send Fax (SNDFAX)
command.
You can take the following code, and integrate it to your own programs.
When both programs are compiled you must use WRFAXVAL and change the
“Post sending User Exit pgm” (on page 4) : Please Note - This does only
apply for the Send Fax feature:
----------------------------------------------------------------------------
--------------
Communication User Exit Program
Dial User Exit Program . . . Name, F4=Prompt
Library . . . . . . . . . Name, *USRLIBL
Post sending User Exit pgm . MYPROG Name, F4=Prompt
Library . . . . . . . . . MYLIB Name, *USRLIBL
----------------------------------------------------------------------------
--------------
Also remember to create the data queue:
CRTDTAQ DTAQ(QGPL/SNDFAXDTAQ) MAXLEN(2000)
----------------------------------------------------------------------------
--------------
CL program MYPROG - Call it what ever you like and remember to change the
CALL stmt marked with red
/* ------------------------------------------------------------- */
/* Company . . . : Agent Data ApS */
/* Design . . . : Bent Ronne */
/* */
/* Sample of "Log Event User Exit Program". */
/* */
/* Sent an event to Data queue SNDFAXDTAQ */
/* ------------------------------------------------------------- */
pgm
Dcl &Status *Dec len(3 0)
Dcl &StsTxt *Char len(30)
Dcl &PFaxNo *Char Len(20)
Dcl &EmailAdr *Char Len(60)
Dcl &RcpName *Char Len(30)
Dcl &User *Char Len(10)
Dcl &DQNAME *Char Len(10) Value('SNDFAXDTAQ')
Dcl &DQLIB *Char Len(10) Value('QGPL')
Dcl &DQLEN *Dec Len(5 0) Value(2000)
Dcl &PSJOB *Char Len(10)
Dcl &PSUSR *Char Len(10)
Dcl &PSJBNO *Char Len(6)
Dcl &PSFILE *Char Len(10)
Dcl &PSNO_ *Dec Len(9 0)
Dcl &PSNO *Char Len( 4)
Dcl &PFXNO *Char Len(20)
Dcl &PSTS *Dec Len(3 0)
Dcl &PMSGID *Char Len(7)
Dcl &PQDATE *Char Len(6)
Dcl &PQDATE_ *Char Len(10)
Dcl &PQTIME *Char Len(6)
Dcl &PQTIME_ *Char Len(8)
Dcl &PPGSNT *Dec Len(5 0)
Dcl &MSGDTA *Char Len(50)
Dcl &USRKEY *Char Len(20)
Dcl &USRDTA *Char Len(256)
/*
==========================================================================
*/
/* Constants
*/
Dcl &Rcv *Dec Value(110) len(3 0) /* Receiving
*/
Dcl &RcvPrtq *Dec Value(120) len(3 0) /* Print Queue (Received)
*/
Dcl &RcvPrt *Dec Value(130) len(3 0) /* Printing
*/
Dcl &SplNoNbr *Dec Value(150) len(3 0) /* Spooling - number missing
*/
Dcl &SplNbrOK *Dec Value(160) len(3 0) /* Spooling - Number OK
*/
Dcl &Dial *Dec Value(170) len(3 0) /* Dialing
*/
Dcl &Sending *Dec Value(180) len(3 0) /* Sending
*/
Dcl &PreQueue *Dec Value(200) len(3 0) /* Prequeue, more pages to
come */
Dcl &SndQ *Dec Value(300) len(3 0) /* Send queue (Ready - number
OK*/
Dcl &Held *Dec Value(400) len(3 0) /* Held
*/
Dcl &RcvErr *Dec Value(510) len(3 0) /* Receive Error
*/
Dcl &Rejected *Dec Value(520) len(3 0) /* Reject in reception
*/
Dcl &SndErr *Dec Value(530) len(3 0) /* Send Error
*/
Dcl &RdyInQ *Dec Value(540) len(3 0) /* Ready in queue - No Number
*/
Dcl &RcvPrted *Dec Value(600) len(3 0) /* Received and printed
*/
Dcl &SndOK *Dec Value(700) len(3 0) /* Sent OK
*/
Dcl &Deleted *Dec Value(999) len(3 0) /* Deleted
*/
/*
==========================================================================
*/
/* Global Error handling -
--------------------- */
MonMsg Cpf0000 Exec(Goto Error)
/* Get the fax attr for the fax just processed */
RtvFaxA FaxSts(&Status) FaxStsTxt(&StsTxt) FaxRcpFaxN(&PFaxNo) +
FaxRcpEml(&EmailAdr) FaxRcpName(&RcpName) SndUsrPrf(&User) +
FaxMsgId(&PMSGID) FaxQDate(&PQDate_) FaxQTime(&PQTime_) +
FaxPagTrns(&PPGSNT) FaxMsgDta(&MSGDTA) FaxUsrKey(&UsrKey) +
FaxUsrDta(&UsrDta)
/* Convert date and time */
CvtDat Date(&PQDate_) ToVar(&PQDATE) FromFmt(*iso) ToFmt(*ymd)
ToSep(*None)
ChgVar &PqTime (%sst(&PqTime_ 1 2) !< +
%sst(&PqTime_ 4 2) !< +
%sst(&PqTime_ 7 2))
/* If sent OK or Error */
if ((&Status = &SndOk) +
*or (&Status = &SndErr)) Then(Do)
/* And loop throught All fax images in the list -
---------------------------------------------- */
RtvFaxLe (* *FIRST) &PSJOB &PSUSR &PSJBNO &PSFILE &PSNO_
NextEntry:
if (&PsJob ^= ' ') Do
ChgVar &PsNo &PsNo_
Call MYPGM2 Parm(&DQNAME &DQLIB &DQLEN &PSJOB &PSUSR &PSJBNO +
&PSFILE &PSNO &PFXNO &Status &PMSGID &PQDATE +
&PQTIME &PPGSNT &MSGDTA &USRKEY &USRDTA)
RtvFaxLe (* *Next) &PSJOB &PSUSR &PSJBNO &PSFILE &PSNO_
GoTo NextEntry
EndDo
EndDo
/* Program termination -
------------------- */
return
/* ----------------------------------------------------------------- */
/*
/* ----------------------------------------------------------------- */
Error:
SndPgmMsg MsgId(Cpf9898) MsgF(Qcpfmsg) MsgDta('User exit program error +
- See Previous listed message, in the job log, +
for more information') +
ToPgmQ(*Same) Msgtype(*Escape)
MonMsg Cpf0000
return
EndPgm
----------------------------------------------------------------------------
--------------
RPG program MYPGM2:
IIFAXDS DS 2000
* The qualified job name
* 10 - character job name
* 10 - character user name
* 6 - character job number
* 10 - character spooled file name
* 4 - character spooled file number
I 1 40 IJOB
I 1 10 ISJOB
I 11 20 ISUSR
I 21 26 ISJBNO
I 27 36 ISFILE
I 37 40 ISNO
* The telephone number
I 41 72 IFXNO
I I '00' 73 74 IMSGT
* S=successfull U=unsuccessfully
I I 'S' 75 75 ICMPST
* The Facsimile Support for OS/400 message identifier.
I 76 82 IMSGID
* The date of the data queue entry.
I 83 88 IQDATE
* The time of the data queue entry.
I 89 94 IQTIME
* The number of pages sent
I 95 990IPGSNT
* The duration of the telephone connection.
I 100 105 IDRTCN
* The name of the fax controller
I 106 113 ICTLD
* The name of the fax card or port used to send the fax
I 114 117 ICRDID
* The substitution text for the returned message identifier
I 118 373 IMSTXT
* The prefix for the telephone number.
I 374 383 INPRFX
* The direct connection type used to send the fax.
I 384 388 IDRCTP
* The option used to process the fax file sent.
I 389 389 IOPT
* The first user-defined field.
I 390 409 I1USRF
* The second user-defined field.
I 410 429 I2USRF
* Reserved.
I** 4302000 IRSV1
* ------------------------------------------------------------- *
* Parameter list *
* ------------------------------------------------------------- *
C *ENTRY PLIST
C PARM DQNAME 10
C PARM DQLIB 10
C PARM DQLEN
C PARM PSJOB 10
C PARM PSUSR 10
C PARM PSJBNO 6
C PARM PSFILE 10
C PARM PSNO 4
C PARM PFXNO 20
C PARM PSTS 30
C PARM PMSGID 7
C PARM PQDATE 6
C PARM PQTIME 6
C PARM PPGSNT 50
C PARM MSGDTA 50
C PARM USRKEY 20
C PARM USRDTA256
* ------------------------------------------------------------- *
* Map from RTVFAXA to IBM/400 data queues *
* ------------------------------------------------------------- *
C MOVELPSJOB ISJOB P
C MOVELPSUSR ISUSR P
C MOVELPSJBNO ISJBNO P
C MOVELPSFILE ISFILE P
C MOVELPSNO ISNO P
C MOVELPFXNO IFXNO P
C PSTS IFEQ 700 Sent OK
C MOVEL'S' ICMPST Successful
C ELSE
C MOVEL'U' ICMPST UnSuccessful
C ENDIF
* The Facsimile Support for OS/400 message identifier.
C MOVELPMSGID IMSGID
* The date of the data queue entry.
C MOVELPQDATE IQDATE
* The time of the data queue entry.
C MOVELPQTIME IQTIME
* The number of pages sent
C Z-ADDPPGSNT IPGSNT
* The duration of the telephone connection.
C MOVEL*BLANK IDRTCN n/a
* The name of the fax controller
C MOVEL*BLANK ICTLD n/a
* The name of the fax card or port used to send the fax
C MOVEL*BLANK ICRDID n/a
* The substitution text for the returned message identifier
C MOVELMSGDTA IMSTXT P
* The prefix for the telephone number.
C MOVEL*BLANK INPRFX n/a
* The direct connection type used to send the fax.
C MOVEL*BLANK IDRCTP n/a
* The option used to process the fax file sent.
C MOVEL*BLANK IOPT n/a
* The first user-defined field.
C MOVELUSRKEY I1USRF
* The second user-defined field.
C MOVELUSRDTA I2USRF
*
C EXSR EVENT
*
C RETRN
* ------------------------------------------------------------- *
* Send an event through the data queue
* ------------------------------------------------------------- *
C EVENT BEGSR
C CALL 'QSNDDTAQ' 8080
C PARM DQNAME 10
C PARM DQLIB 10
C PARM DQLEN 50
C PARM IFAXDS
C ENDSR