I set up a receive data queue with the addfaxcrd command.    I use 
QRCVDTAQ to read the entries on the data queue, then PRTFAX.  Then based 
on the routing code I email the user a PDF of the "printed" fax using 
Gumbo's SNDSPLMAIL command. 

Here is the source


             PGM        /*   email received faxes  */  
  
             DCL        VAR(&QUEUE) TYPE(*CHAR) LEN(10) +  
                          VALUE('QFFRCVDQ')  
             DCL        VAR(&LIB) TYPE(*CHAR) LEN(10) VALUE('QUSRSYS')   
             DCL        VAR(&DATA) TYPE(*CHAR) LEN(2000)  
             DCL        VAR(&LEN) TYPE(*DEC) LEN(5 0)  
             DCL        VAR(&WAIT) TYPE(*DEC) LEN(5 0) VALUE(60)  
  
             DCL        VAR(&FDRLIB) TYPE(*CHAR) LEN(10) /*FAX +  
                          DATABASE LIBRARY */  
             DCL        VAR(&FDRDBF) TYPE(*CHAR) LEN(10) /*FAX +  
                          DATABASE FILE */  
             DCL        VAR(&FDRMBR) TYPE(*CHAR) LEN(10) /*FAX +  
                          DATABASE FILE MEMBER */  
             DCL        VAR(&FDRPAG) TYPE(*CHAR) LEN(5) /*NUMBER OF +  
                          PAGES RECEIVED */  
             DCL        VAR(&TSICDE) TYPE(*CHAR) LEN(20) /*TSI CODE +  
                          OF SENDING FAX DEVICE */  
             DCL        VAR(&RCVCDE) TYPE(*CHAR) LEN(1) /*RECEIVED +  
                          CODE -S=SUCCESSFUL OR U =UNSUCCESSFUL */  
             DCL        VAR(&RTGCDE) TYPE(*CHAR) LEN(10) /* ROUTING +  
                          CODE */  
             DCL        VAR(&MSG) TYPE(*CHAR) LEN(40) VALUE('Fax +  
                          was not received successfully')  
             DCL        VAR(&STATUS) TYPE(*CHAR) LEN(40)  
             DCL        VAR(&DATE) TYPE(*CHAR) LEN(8)  
             DCL        VAR(&TIME) TYPE(*CHAR) LEN(6)  
             DCL        VAR(&ENDSTS) TYPE(*CHAR) LEN(1)  
             DCL        VAR(&CRLF) TYPE(*CHAR) LEN(2) VALUE(X'0A0D')  
             DCL        VAR(&USERID) TYPE(*CHAR) LEN(8)  
             DCL        VAR(&ADDRESS) TYPE(*CHAR) LEN(8)  
  
             OVRPRTF    FILE(*PRTF) HOLD(*YES)  
  
 START:      CALL       QRCVDTAQ PARM(&QUEUE &LIB &LEN &DATA &WAIT)  
  
             IF         COND(&LEN = 0) THEN(DO)  
             RTVJOBA    ENDSTS(&ENDSTS)  
             IF         COND(&ENDSTS = '1') THEN(GOTO CMDLBL(ENDPGM))  
             ELSE       CMD(GOTO CMDLBL(START))  
             ENDDO  
  
             CHGVAR     &FDRLIB %SST(&DATA 01 10)  
             CHGVAR     &FDRDBF %SST(&DATA 11 10)  
             CHGVAR     &FDRMBR %SST(&DATA 21 10)  
             CHGVAR     &FDRPAG %SST(&DATA 31 05)  
             CHGVAR     &TSICDE %SST(&DATA 36 20)  
             CHGVAR     &RCVCDE %SST(&DATA 56 01)  
             CHGVAR     &TIME   %SST(&DATA 75 06)  
             CHGVAR     &RTGCDE %SST(&DATA 81 4)  
             CHGVAR     &DATE   %SST(&DATA 91 08)  
  
             IF         COND(&RCVCDE *EQ 'U') THEN(CHGVAR +  
                          VAR(&STATUS) VALUE(&MSG))  
             ELSE       CMD(CHGVAR VAR(&STATUS) VALUE(' '))  
  
             CHKOBJ     OBJ(&FDRLIB/&FDRDBF) OBJTYPE(*FILE) +  
                          MBR(&FDRMBR)  
             MONMSG     MSGID(CPF9815) EXEC(GOTO CMDLBL(START))  
  
             RTVFAXRTG  ROUTING(&RTGCDE) LISTID(&USERID) +  
                          LISTADDR(&ADDRESS)  
  
             PRTFAX     FAXFILE(&FDRLIB/&FDRDBF) FAXMBR(&FDRMBR) +  
                          DLTFAX(*YES)  
             SNDSPLMAIL FILE(&FDRMBR) TRANSFORM(*PDFLETTER) +  
                          TOUSRID(&USERID &ADDRESS) SUBJECT('Fax +  
                          received from' *BCAT &TSICDE) +  
                          MSG('Distribution list' *BCAT &USERID +  
                          *BCAT &ADDRESS *BCAT &CRLF *CAT &CRLF +  
                          *CAT 'Fax received from' *BCAT &TSICDE +  
                          *TCAT '. Pages received' *BCAT &FDRPAG +  
                          *CAT '. Received' *BCAT &DATE *BCAT &TIME +  
                          *CAT '. Routing code' *BCAT &RTGCDE *TCAT +  
                          '.' *BCAT &STATUS *CAT &CRLF) DLTSPLF(*YES)  
             GOTO START  
  
 ENDPGM:     ENDPGM  

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.