×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




How are you running that SQL statement? As embedded SQL in an RPG
program using a cursor? Using Select Into a data structure? Creating a
file that contains the information? IOW, running the SQL statement
will provide a means of ordering and selecting the data, but it
doesn't make it available to a program. How do you plan on making the
SQL-derived data accessible to the RPG program?

On Thu, Sep 11, 2008 at 8:39 AM, <steve.dyke@xxxxxxxxxxxxxxxx> wrote:
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?



--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.


--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2026 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.