|
Hi All, Require help on QSYGETPH.. The API is modified in V5R3 and requires two additional parameters additional parameter for length of password and CCSID both parameters are Input ,Binary 4 .. How to pass those values.. Following types I had used .. but all of them failed * Defined in D specs GetProfile PR ExtPgm('QSYGETPH') UserID 10A const Password 10A const Handle 12A ErrorCode 32766A options(*varsize: *nopass) PassLength 4B 0 options(*nopass) PassCCSID 4B 0 options(*nopass) callp GetProfile(userid: passwd: handle: dsEC: passlengthb: passccsidb) Kindly help how to pass the passwordlength and its ccsid parameters (password length is 8) Thanks in advance Regards -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of rpg400-l-request@xxxxxxxxxxxx Sent: Friday, April 08, 2005 2:09 PM To: rpg400-l@xxxxxxxxxxxx Subject: RPG400-L Digest, Vol 4, Issue 423 Send RPG400-L mailing list submissions to rpg400-l@xxxxxxxxxxxx To subscribe or unsubscribe via the World Wide Web, visit http://lists.midrange.com/mailman/listinfo/rpg400-l or, via email, send a message with subject or body 'help' to rpg400-l-request@xxxxxxxxxxxx You can reach the person managing the list at rpg400-l-owner@xxxxxxxxxxxx When replying, please edit your Subject line so it is more specific than "Re: Contents of RPG400-L digest..." Today's Topics: 1. RE: What would be your SQL solution? (fkany@xxxxxxxxxxxxxxxxxx) 2. RE: What would be your SQL solution? (rob@xxxxxxxxx) 3. RE: primary and secondary files, match fields, summarizing/printi ng single line per key (Ma?oso, Carl) 4. RE: primary and secondary files, match fields, summarizing/printi ng single line per key (Barton, Mike) 5. RE: primary and secondary files, match fields, summarizing/printi ng single line per key (Ma?oso, Carl) ---------------------------------------------------------------------- message: 1 date: Thu, 7 Apr 2005 16:31:46 -0500 from: fkany@xxxxxxxxxxxxxxxxxx subject: RE: What would be your SQL solution? You're right. It doesn't like host variables in the RPGIV program for this DECLARE statement. How can I code it to except my host variable? Here's my current code: C/EXEC SQL C+ DECLARE GLOBAL TEMPORARY TABLE FR47P457A AS (SELECT FHOT, FHPRO, C+ FHDT, FHDDAT, FHDTIM, FHDADT, FHPUDT, FHSCD, FHCCD, FHCCT, FHCZIP C+ FROM FRL00144 WHERE FHDDAT >= :FDATE AND FHDDAT <= :TDATE) WITH C+ DATA C/END-EXEC with the colons in front of FDATE and TDATE, the program gives a syntax error message. Thanks, Frank "Ross Hartford" <ross.hartford@xxxxxxxxxxx>@midrange.com on 04/07/2005 10:46:21 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx To: "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx> cc: Subject: RE: What would be your SQL solution? Mine takes one SQL statement and creates a temporary table in QTEMP with the selected records: declare global temporary table temp1 as ( select x1,x2,n1,n2 from ross/xxxx where n1 > 0 and n2 > 0) with data I think you may have to build this as a dynamic SQL statement and execute it, versus doing the where clause with host variables. Just replace the x1,x2, etc with your list of fields and give it a shot in STRSQL or your favorite SQL test tool. Ross Hartford Cothern Computer Systems, Inc. 1640 Lelia Drive, Suite 200 Jackson, MS 39216 Phone: 601-718-0803 Fax: 601-969-1184 Support: 888-222-5577 email: rossh@xxxxxxxxxxx website: www.ccslink.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of fkany@xxxxxxxxxxxxxxxxxx Sent: Thursday, April 07, 2005 9:16 AM To: CN=RPG programming on the AS400/O=iSeries Subject: What would be your SQL solution? I've been trying to figure out an embedded SQL solution for my RPGIV READ loop for over a week now. I feel like I'm "spinning my wheels". I'm going to post the details of my project. If anyone would like to share how they would use SQL to complete the task, please do so. The program currently takes an hour or more to process. I don't want to create anymore logicals over the file it currently uses because the file just seems to have too many logicals(close to 100). Even with all the logicals the file currently has, our users are still accustomed to waiting a day or more for a large report to print. I'd like to help speed things up. Nobody in our shop, including me, is aware of how fast SQL really is at getting large amounts of data at 1 time. Thanks, Frank System Information: V5R2 Programming language: RPGIV (Part 1) - This part takes an hour or more to process using an RPGIV READ loop with a typical date range of 1 month(20040501 to 20040531) Program(RPGIVPGM1) is called with parameters(FROMDATE & TODATE): CALL RPGIVPGM1(FROMDATE TODATE) RPGIVPGM1 will populate BFILE with all records from AFILE within the date range specified(FROMDATE & TODATE). The only fields needed from AFILE to populate BFILE are: FHOT, FHPRO, FHDT, FHDDAT, FHDTIM, FHDADT, FHPUDT, FHSCD, FHCCD, FHCCT, & FHCZIP. BFILE is keyed only on FHDDAT, which is what date the FROMDATE & TODATE should be referencing. (Part 2) - After BFILE is built from Part 1, this section only takes a few seconds to run. RPGIVPGM2 will access BFILE by FHDDAT and print a report. AFILE has 7 million records. BFILE, if populated with 1 month of data(20040501 to 20040531) will have 400,000 records. RPGIV shell, please make any necessary changes: H DFTACTGRP(*NO) '* '* ---------- '* '* ---------------------- D FROMDATE S 8S 0 D TODATE S 8S 0 '* '* Arrays/Data Structures '* ---------------------- '* '* ----------- ?* Main Processing D MAIN_PRCS PR ********************************************************************** '* '* --------------------- C CALLP MAIN_PRCS '* '* ------------------- ?* End Program, Return to Caller C EVAL *INLR = *ON C RETURN * ?* C *ENTRY PLIST C PARM FROMDATE C PARM TODATE ?* * ?* -- 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. ------------------------------ message: 2 date: Thu, 7 Apr 2005 16:49:35 -0500 from: rob@xxxxxxxxx subject: RE: What would be your SQL solution? Read the following: http://publib.boulder.ibm.com/infocenter/iseries/v5r3/ic2924/info/db2/rbafzm st02.htm You will be using the PREPARE statement and the EXECUTE statement. You'll end up doing something like /free myvar='DECLARE........WHERE FHDATE>=' + FDATE + '.............'; /end-free then you'll be doing a sql prepare stmt from :myvar then you'll be doing a sql execute stmt Ok? Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com fkany@xxxxxxxxxxxxxxxxxx Sent by: rpg400-l-bounces@xxxxxxxxxxxx 04/07/2005 04:31 PM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To CN=RPG programming on the AS400/O=iSeries <rpg400-l@xxxxxxxxxxxx> cc Subject RE: What would be your SQL solution? You're right. It doesn't like host variables in the RPGIV program for this DECLARE statement. How can I code it to except my host variable? Here's my current code: C/EXEC SQL C+ DECLARE GLOBAL TEMPORARY TABLE FR47P457A AS (SELECT FHOT, FHPRO, C+ FHDT, FHDDAT, FHDTIM, FHDADT, FHPUDT, FHSCD, FHCCD, FHCCT, FHCZIP C+ FROM FRL00144 WHERE FHDDAT >= :FDATE AND FHDDAT <= :TDATE) WITH C+ DATA C/END-EXEC with the colons in front of FDATE and TDATE, the program gives a syntax error message. Thanks, Frank "Ross Hartford" <ross.hartford@xxxxxxxxxxx>@midrange.com on 04/07/2005 10:46:21 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx To: "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx> cc: Subject: RE: What would be your SQL solution? Mine takes one SQL statement and creates a temporary table in QTEMP with the selected records: declare global temporary table temp1 as ( select x1,x2,n1,n2 from ross/xxxx where n1 > 0 and n2 > 0) with data I think you may have to build this as a dynamic SQL statement and execute it, versus doing the where clause with host variables. Just replace the x1,x2, etc with your list of fields and give it a shot in STRSQL or your favorite SQL test tool. Ross Hartford Cothern Computer Systems, Inc. 1640 Lelia Drive, Suite 200 Jackson, MS 39216 Phone: 601-718-0803 Fax: 601-969-1184 Support: 888-222-5577 email: rossh@xxxxxxxxxxx website: www.ccslink.com -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of fkany@xxxxxxxxxxxxxxxxxx Sent: Thursday, April 07, 2005 9:16 AM To: CN=RPG programming on the AS400/O=iSeries Subject: What would be your SQL solution? I've been trying to figure out an embedded SQL solution for my RPGIV READ loop for over a week now. I feel like I'm "spinning my wheels". I'm going to post the details of my project. If anyone would like to share how they would use SQL to complete the task, please do so. The program currently takes an hour or more to process. I don't want to create anymore logicals over the file it currently uses because the file just seems to have too many logicals(close to 100). Even with all the logicals the file currently has, our users are still accustomed to waiting a day or more for a large report to print. I'd like to help speed things up. Nobody in our shop, including me, is aware of how fast SQL really is at getting large amounts of data at 1 time. Thanks, Frank System Information: V5R2 Programming language: RPGIV (Part 1) - This part takes an hour or more to process using an RPGIV READ loop with a typical date range of 1 month(20040501 to 20040531) Program(RPGIVPGM1) is called with parameters(FROMDATE & TODATE): CALL RPGIVPGM1(FROMDATE TODATE) RPGIVPGM1 will populate BFILE with all records from AFILE within the date range specified(FROMDATE & TODATE). The only fields needed from AFILE to populate BFILE are: FHOT, FHPRO, FHDT, FHDDAT, FHDTIM, FHDADT, FHPUDT, FHSCD, FHCCD, FHCCT, & FHCZIP. BFILE is keyed only on FHDDAT, which is what date the FROMDATE & TODATE should be referencing. (Part 2) - After BFILE is built from Part 1, this section only takes a few seconds to run. RPGIVPGM2 will access BFILE by FHDDAT and print a report. AFILE has 7 million records. BFILE, if populated with 1 month of data(20040501 to 20040531) will have 400,000 records. RPGIV shell, please make any necessary changes: H DFTACTGRP(*NO) '* '* ---------- '* '* ---------------------- D FROMDATE S 8S 0 D TODATE S 8S 0 '* '* Arrays/Data Structures '* ---------------------- '* '* ----------- ?* Main Processing D MAIN_PRCS PR ********************************************************************** '* '* --------------------- C CALLP MAIN_PRCS '* '* ------------------- ?* End Program, Return to Caller C EVAL *INLR = *ON C RETURN * ?* C *ENTRY PLIST C PARM FROMDATE C PARM TODATE ?* * ?* -- 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. -- 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. ------------------------------ message: 3 date: Fri, 8 Apr 2005 09:37:16 +0800 from: "Ma?oso, Carl" <ManosoCS@xxxxxxxxxxxxxxxxx> subject: RE: primary and secondary files, match fields, summarizing/printi ng single line per key Mike, Sudha, Rick, Thank you for answering. I'm sorry if my replies are coming in late. I'm in a GMT+8 time zone. I can say for certain (using the interactive debugger) that all the control fields have the same value, and *INL1 is triggered twice every time, once for the primary and another time for the secondary. I also tried Rick's suggestion of using the MR indicator, but the result is the same. Is this perhaps a limitation of the language? And can't be done without the use of an extract file as Mike suggested? -- Carl Mañoso "It is not real work unless you would rather be doing something else." [J.M.BARRIE] > -----Original Message----- > From: Barton, Mike > Sent: Thursday, April 07, 2005 11:20 PM > > Carl > using matching records the way u are should be able > to achieve what you want. > I suggest you check the values in all the *INL1 fields to > accertain that they are the same for the 2 separate lines. > L1 will only come on after all records from both files have > been read. > > One only other way is to create an extract file from the > 2 (or more files) and then read the result file with > level breaks. > > HTH > > Mike > > -----Original Message----- > From: "Mañoso, Carl" [mailto:ManosoCS@xxxxxxxxxxxxxxxxx] > Sent: 07 April 2005 01:29 > To: rpg400-l (E-mail) > Subject: primary and secondary files, match fields, > summarizing/printing > s ingle line per key > > > Mabuhay RPG gurus! > > A colleague has this problem, which I cannot solve, involving > primary and > secondary files and match fields. Here are the relevant code > fragments and a > sample output. A record pertaining to a particular key > doesn't necessarily > have to be in both files. > > SAMPLE PROGRAM > ============== > IPLNMJ1 01 > I PLOYER M6 > I PLOMKTL3M5 > I PLOIGRL2M4 > I PLOCSZL1M3 > I PLOCVTL1M2 > I PLOITML1M1 > IINVSUM 02 > I IVSYER M6 > I IVSMKTL3M5 > I IVSIGRL2M4 > I IVSCSZL1M3 > I IVSCVTL1M2 > I IVSITML1M1 > ---------- > MAIN > ---------- > . > . > . > CL1 EXSR PRTDTL > . > . > > > SAMPLE OUTPUT > ============= > Cur > Mo. Total > Item_ Size__ Variety___ Market_PO_Description____ > ___PO__ Shipmts > CONC FOR DC OR DIRECT > > *1* 01160 12-46 PO EUROPE MARKET 1,000 > > *1* 01160 12-46 PO EUROPE MARKET > 204 > > *2* 01254 6-10 J- EUROPE MARKET > 1,000 > *2* 01254 6-10 J- EUROPE MARKET > 272 > > Sub-total > 2,000 476 > > > QUESTION > ======== > *INL1 controls the printing of a detail line. In the sample > output above, > lines indicated by *1* should supposedly appear in one line, > lines indicated > by *2* also in one line. However, as you can see, *INL1 is > triggered twice, > one for each file (primary and secondary), so that they were > printed on two > separate lines. Printing on every other setting of *INL1 also > doesn't work > because the records pertaining to a particular key need not > appear in both > files. > > Does anybody here knows of a technique that will print the > summary of a > record with details coming from two separate files in a > single line? We are > using RPG/400 on V4R5M0 (by order of our BDFL). > > Thanks in advance. ------------------------------ message: 4 date: Fri, 8 Apr 2005 08:20:48 +0100 from: "Barton, Mike" <Mike.Barton@xxxxxxxxxxxxxxxxx> subject: RE: primary and secondary files, match fields, summarizing/printi ng single line per key Carl no its not a limitation of the language. I have used Primary/secondary Matching record programs a fair bit and still use them where its the best solution. I asked that all L1 fields were the same, this also applies to L2 and L3 (which will also cause L1 to be on). Incidentally, I don't use MR at all. The only difference I see between your version & what I have used is that you have M6 level but with no level break indicator against them. I assume this is ok since the compiler would have thrown it out. As mentioned earlier, its best to rename one set of fields to be the same as the other file fields. Unfortunately I cannot quite see what is the problem.... Mike -----Original Message----- From: "Mañoso, Carl" [mailto:ManosoCS@xxxxxxxxxxxxxxxxx] Sent: 08 April 2005 02:37 To: 'RPG programming on the AS400 / iSeries' Subject: RE: primary and secondary files, match fields, summarizing/printi ng single line per key Mike, Sudha, Rick, Thank you for answering. I'm sorry if my replies are coming in late. I'm in a GMT+8 time zone. I can say for certain (using the interactive debugger) that all the control fields have the same value, and *INL1 is triggered twice every time, once for the primary and another time for the secondary. I also tried Rick's suggestion of using the MR indicator, but the result is the same. Is this perhaps a limitation of the language? And can't be done without the use of an extract file as Mike suggested? -- Carl Mañoso "It is not real work unless you would rather be doing something else." [J.M.BARRIE] ########################################### This message has been scanned by F-Secure Anti-Virus for Microsoft Exchange. For more information, connect to http://www.F-Secure.com/ ********************************************************************** This communication and the information it contains: - (a) Is intended for the person(s) or organisation(s) named above and for no other person(s) or organisation(s). Access to this mail by anyone else is unauthorised. (b) Is confidential, and may be legally privileged or otherwise protected in law. Unauthorised use, circulation, copying or disclosure of any part of this communication may be unlawful. (c) May be susceptible to interference, and should not be assumed that it has come in its original form and/or from the stated sender or PinkRoccade UK accepts no responsibility for information, errors or omissions in this e-mail or use or misuse thereof or any act done or omitted to be done in connection with this communication. If you are not the intended recipient, please inform postmaster@xxxxxxxxxxxxxxxxx immediately and delete it and all copies from your system. www.pinkroccade.co.uk ********************************************************************** ------------------------------ message: 5 date: Fri, 8 Apr 2005 16:38:27 +0800 from: "Ma?oso, Carl" <ManosoCS@xxxxxxxxxxxxxxxxx> subject: RE: primary and secondary files, match fields, summarizing/printi ng single line per key > -----Original Message----- > From: Barton, Mike > Sent: Friday, April 08, 2005 3:21 PM > > I asked that all L1 fields were the same, this > also applies to L2 and L3 (which will also cause > L1 to be on). Incidentally, I don't use MR at all. Yup. This is what we did. We monitored the values of all control level fields using the interactive debugger. > > The only difference I see between your version > & what I have used is that you have M6 level > but with no level break indicator against them. > I assume this is ok since the compiler would have > thrown it out. > > As mentioned earlier, its best to rename one set > of fields to be the same as the other file fields. Tried this as well, just now. The problem persists. > > Unfortunately I cannot quite see what is the > problem.... > I don't know whether to call it a problem, or not. Perhaps this is really how RPG/400 works. But what we observed using the interactive debugger is that *INL1 is set after reading the primary file without first finishing reading the secondary files (with equal/equivalent keys). Here's a partial listing of the query on the two files in question. After reading the first record of CSPLNORD, *INL1 is set and triggers the printing of details. It then proceeds to reading the first two records of the secondary file, setting *INL1, and triggering the printing of another detail line. CSPLNORD ======== PLOYER PLOMKT PLOIGR PLOCSZ PLOCVT PLOITM PLOC01 MPODES 2,005 EUR CD 30 352 01160 1,000 EUROPE MARK 2,005 35 304 01254 1,000 EUROPE MARK TOTAL 2,000 2,005 JC 05 106 01255 1,000 EUROPE MARK 2,005 10 302 01250 1,000 EUROPE MARK TOTAL 2,000 2,005 MS 10 304 01250 1,000 EUROPE MARK TOTAL 1,000 2,005 PL 10 352 01159 1,000 EUROPE MARK 2,005 30 304 01253 1,000 EUROPE MARK TOTAL 2,000 TOTAL 7,000 2,005 USA 01 10 302 01250 1,000 USA MARKET 2,005 15 811 00198 1,000 USA MARKET CSINVSUM ======== IVSYER IVSMKT IVSIGR IVSCSZ IVSCVT IVSITM IVSITP IVSCSE 2,005 EUR CD 30 352 01160 S 204 2,005 30 352 01160 E 176 2,005 JC 05 106 01255 S 408 2,005 05 106 01255 E 8 2,005 10 302 01250 S 1,156 2,005 10 302 01250 E 20 2,005 MS 10 304 01250 S 748 2,005 10 304 01250 E 546 2,005 PL 10 352 01159 S 340 2,005 10 352 01159 E 172 2,005 30 304 01253 S 272 2,005 30 304 01253 E 138 2,005 USA 10 304 01250 S 1,240 2,005 10 304 01250 E 4,240 IPLNMJ1 01 I PLOYER M6 I PLOMKTL3M5 I PLOIGRL2M4 I PLOCSZL1M3 I PLOCVTL1M2 I PLOITML1M1 IINVSUM 02 I IVSYER M6 I IVSMKTL3M5 I IVSIGRL2M4 I IVSCSZL1M3 I IVSCVTL1M2 I IVSITML1M1 ---------- MAIN ---------- . . . CL1 EXSR PRTDTL . . SAMPLE OUTPUT ============= Cur Mo. Total Item_ Size__ Variety___ Market_PO_Description____ ___PO__ Shipmts CONC FOR DC OR DIRECT 01160 12-46 PO EUROPE MARKET 1,000 01160 12-46 PO EUROPE MARKET 204 01254 6-10 J- EUROPE MARKET 1,000 01254 6-10 J- EUROPE MARKET 272 Sub-total 2,000 476 I guess the way to go is an extract file. -- Carl Mañoso "It is not real work unless you would rather be doing something else." [J.M.BARRIE] ------------------------------ -- This is the RPG programming on the AS400 / iSeries (RPG400-L) digest 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. End of RPG400-L Digest, Vol 4, Issue 423 **************************************** IMPORTANT NOTICE: The information in this email (and any attachments) is confidential. If you are not the intended recipient, you must not use or disseminate the information. If you have received this email in error, please immediately notify me by "Reply" command and permanently delete the original and any copies or printouts thereof. Although this email and any attachments are believed to be free of any virus or other defect that might affect any computer system into which it is received and opened, it is the responsibility of the recipient to ensure that it is virus free and no responsibility is accepted by American International Group, Inc. or its subsidiaries or affiliates either jointly or severally, for any loss or damage arising in any way from its use.
As an Amazon Associate we earn from qualifying purchases.
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.