> Tech > Figures

Figures

Tech - Par Renaud ROSSET - Publié le 24 juin 2010
email

FIGURE 1
Exemple d'enregistrement avec des tags HTML

<html><head>
<title>A/R Statement</title>
</head>
<body><center><h2>XYZ Company</h2><h3>Account statement for NAME~
</h3><h4>DATE~
</h4><table><tr><td></td><td>Beginning Balance:</td><td>BEGBAL~
</td></tr>
<tr><td colspan="3"><hr></td></tr><tr><td align="center">
Transaction Date<hr></td><td>Description<hr></td>
<td>Amount<hr></td> </tr>
<tr><td>TRANDATE~
</td><td>TRANDESC~
</td><td>TRANAMOUNT~
</td></tr>
<tr><td colspan="3"><hr></td></tr>
<tr><td></td><td>Ending Balance</td><td>ENDBAL~
</td></tr></table> </center> </body> </html>


FIGURE 2
Fichier maître client (Customer)
A

Figures

R PMASTER
A CUSTID 8 COLHDG(‘Customer’ ‘ID’)
A NAME 40 COLHDG(‘Customer’ ‘Name’)
A EMAIL 40 COLHDG(‘E-mail Address’)
A BEGBAL 13 2 COLHDG(‘Account’ ‘Balance’)
A K CUSTID

FIGURE 3
Fichier de transactions client (Customer)

A         R PTRANS
A CUSTID 8 COLHDG(‘Customer’ ‘ID’)
A TRANDATE L COLHDG(‘TRANSACTION’ ‘DATE’)
A TRANDESC 40 COLHDG(‘DESCRIPTION’)
A TRANAMOUNT 13 2 COLHDG(‘AMOUNT’)
A K CUSTID
A K TRANDATE

FIGURE 4
Programme ARCSNDEMAL

/* Program ARCSNDEMAL */
/* */
/* Program receives as input a customer ID, beginning date, and */
/* ending date. Then calls ARREMAIL, which will format a file in */
/* HTML code containing the monthly A/R statement for the customer. */
/* If the customer ID is invalid, an error message will be returned. */
/* Otherwise, the document created is sent as an e-mail */
/* attachment to the customer. */
        PGM PARM(&CUSTID &DATBEG &DATEND &ERRMSG)
        DCL VAR(&DATEND) TYPE(*CHAR) LEN(10)
        DCL VAR(&DATBEG) TYPE(*CHAR) LEN(10)
        DCL VAR(&CUSTID) TYPE(*CHAR) LEN(8)
        DCL VAR(&ERRMSG) TYPE(*CHAR) LEN(20)
        DCL VAR(&EMAIL) TYPE(*CHAR) LEN(40)
        DCL VAR(&ATC) TYPE(*CHAR) LEN(40)
        CLRPFM HTMLDATA
        CALL PGM(ARREMAIL) PARM(&CUSTID &DATBEG &DATEND +
                &ERRMSG &EMAIL)
        IF COND(&ERRMSG = ' ') THEN(DO)
        CHGVAR VAR(&ATC) VALUE('/QDLS/AREMAIL/' *CAT &CUSTID)
/* Copy the formatted file to QDLS file system */
        CPYTOPCD FROMFILE(HTMLDATA) TOFLR(AREMAIL) +
                TODOC(&CUSTID) REPLACE(*YES)
        CCCSNDMAIL RECIPADDR(&EMAIL) +
                SENDERADDR(ARCLERK@MYCOMPANY.COM) +
                SENDERNAME('A/R CLERK') ATTACHMENT(&ATC) +
                SUBJECT('A/R MONTHLY STATEMENT') +
                MESSAGE('This email contains an attached +
                file with your monthly statement.')
        ENDDO
        ENDPGM

FIGURE 5
Commande CCCSNDMAIL

/****************************************************************/
/* To create this command, issue the following: */
/* CRTCMD lib/CCCSNDMAIL SRCFILE(srclib/srcfile)
PGM(lib/CCRSNDMAIL) */
/* NEWS/400, September 1998 */
/* Copyright (c) 1998 Duke Communications International */
/* ALL RIGHTS RESERVED */
/****************************************************************/
CMD     PROMPT('Send an E-mail Message')
PARM    KWD(FILENAME) TYPE(*PNAME) LEN(256) +
          RTNVAL  (*NO) DFT('/tmp/mimehdr.txt') +
          MIN(0) EXPR(*YES) PROMPT('MIME header +
          file name' 1)
PARM    KWD(RECIPADDR) TYPE(*PNAME) LEN(256) MIN(1) +
          EXPR(*YES) PROMPT('E-mail address of +
          recipient' 2)
PARM    KWD(SENDERADDR) TYPE(*PNAME) LEN(256) MIN(1) +
          EXPR(*YES) PROMPT('E-mail address of +
          sender' 4)
PARM    KWD(RECIPNAME) TYPE(*CHAR) LEN(256) +
          DFT(*NONE) SPCVAL((*NONE '')) EXPR(*YES) +
          PROMPT('Name of e-mail recipient' 3)
PARM    KWD(SENDERNAME) TYPE(*CHAR) LEN(256) +
          DFT(*NONE) SPCVAL((*NONE '')) EXPR(*YES) +
          PROMPT('Name of e-mail sender' 5)
PARM    KWD(ATTACHMENT) TYPE(*PNAME) LEN(256) +
          DFT(*NONE) SNGVAL((*NONE)) MAX(30) +
          EXPR(*YES) PROMPT('File attachment')
PARM    KWD(SUBJECT) TYPE(*CHAR) LEN(256) DFT(*NONE) +
          SPCVAL((*NONE '')) EXPR(*YES) +
          PROMPT('Subject')
PARM    KWD(MESSAGE) TYPE(*CHAR) LEN(32767) +
          DFT(*NONE) SPCVAL((*NONE '')) EXPR(*YES) +
          PROMPT('Message')
PARM    KWD(MIMETYPE) TYPE(*CHAR) LEN(5) +
          DFT('plain') SPCVAL((*NONE '')) EXPR(*NO) +
          PROMPT('Mime-type')

Téléchargez cette ressource

Guide inmac wstore pour l’équipement IT de l’entreprise

Guide inmac wstore pour l’équipement IT de l’entreprise

Découvrez les dernières tendances et solutions IT autour des univers de Poste de travail, Affichage et Collaboration, Impression et Infrastructure, et notre nouveau dossier thématique sur l’éco-conception et les bonnes pratiques à adopter pour réduire votre impact environnemental.

Tech - Par Renaud ROSSET - Publié le 24 juin 2010