Please disreguard my last post.
This is the sql statement I need for getting e-mail addresses. It uses two
different libraries. The wend date parameter will have to be dynamically
calculated based on the next Sunday from the date the program is ran:
testString = "Select (CASE WHEN userp4 is null Then
CONCAT(CONCAT(CONCAT(TRIM(fname),'.'),TRIM(lname)),'@weber.zodiac.com')"
+;
" WHEN userp4 = '' THEN
CONCAT(CONCAT(CONCAT(TRIM(fname),'.'),TRIM(lname)),'@weber.zodiac.com')
Else userp4 END) As userp4" +;
" From oipayfiles.employee" +;
" Join oipayfiles.jcmaster On oipayfiles.employee.jobcls =
oipayfiles.jcmaster.jccode" +;
" Left Join webprddt6.resmngt10 On webprddt6.resmngt10.userid =
oipayfiles.employee.prurf1" +;
" Where badge Not In(Select badgeno From webprddt6.engpmtbl6 Where wend =
'09/07/2008')" +;
" And epemst in('ISAL','DSAL')" +;
" And (posstr(jcdsc,'PRESIDENT') < 1" +;
" And posstr(jcdsc,'ACCOUNTANT') < 1" +;
" And posstr(jcdsc,'CHIEF') < 1" +;
" And posstr(jcdsc,'MANAGER') < 1" +;
" And posstr(jcdsc,'DIRECTOR') < 1 Or badge in('61429','57394','9637'))"
+;
" And emdelt = 'A'" +;
" Order By emorg2, badge"
"Aaron Bartell" <aaronbartell@xxxxxxxxx>
Sent by: rpg400-l-bounces@xxxxxxxxxxxx
09/11/2008 06:17 AM
Please respond to
RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
To
"RPG programming on the AS400 / iSeries" <rpg400-l@xxxxxxxxxxxx>
cc
Subject
Re: Need Help with Email from RPG
Now my next challenge is to iterate through a file of e-mail addresses
and
dynamically populate the to field. Can you help with this?
You bet. Just iterate over the RPGMail_addAddress() API with a DO loop.
setll key file;
reade key file;
dow not %eof(file);
RPGMail_addAddress(email: 'TO': DB2EMLADR: DB2CUSTNAM);
enddo;
HTH,
Aaron Bartell
http://mowyourlawn.com
On Wed, Sep 10, 2008 at 1:27 PM, <steve.dyke@xxxxxxxxxxxxxxxx> wrote:
I am sorta new at all this. However, I did consider the fact that I was
not specifiying the error. Trouble was all I knew was I had a 15 page
spool file, which part would I send.
Anyway I figured out I was not in the correct library for the compile.
After I fixed that it compiled okay. I sent my first email.
Now my next challenge is to iterate through a file of e-mail addresses
and
dynamically populate the to field. Can you help with this?
As an Amazon Associate we earn from qualifying purchases.