× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hi John,

I always Read a file and Write a record so I am reading a file name.

I used DBU on the same file (EDII810JH4) with the key in the progam (I
obtained the values in debug) and the record exists so it's not Key
sequences or Keys on the file.

Thanks,

Rob

On Wed, Jun 2, 2010 at 3:13 AM, John McKay <jmckay@xxxxxxxxxxxxxxxx> wrote:

Are you reading from a file name or a record format name - if the latter
are
there any record selection(s) which may invalidate your read?

Key sequences...?
Keys on the files...?


Regards,
John McKay
www.rpglanguage.com
www.mckaysoftware.ie

----- Original Message -----
From: "Robert Rogerson" <rogersonra@xxxxxxxxx>
To: "RPG programming on the IBM i / System i" <RPG400-L@xxxxxxxxxxxx>
Sent: Tuesday, June 01, 2010 9:55 PM
Subject: Setll and Reade not working as esxpected....


Okay, try as I might I can not find an explanation for this.

In my program I am check if an invoice and dunsnumber were passed into
the
program. If so, then only one invoice is processed. Otherwise all
invoices are processed. The code I have is:

// If an invoice and duns number where passed to this program
// only process a single invoice
// otherwise process all invoice where processed = *blanks
If invoiceIn <> *blanks and
dunsnbrIn <> *blanks;
Setll (invoiceIn: dunsnbrIn) EDII810JH4;
rc = %Equal();
Reade (invoiceIn: dunsnbrIn) EDII810JH4;
rc = %Eof();

Else;
Setll *start EDII810JH4;
Read EDII810JH4;
Endif;

Dow not %Eof(EDII810JH4);

....Processing

If invoiceIn <> *blanks and
dunsnbrIn <> *blanks;
Reade (invoiceIn: dunsnbrIn) EDII810JH4;

Else;

Read EDII810JH4;
Endif;
Enddo;

I added the rc to check the values of %Equal() and %Eof() while in debug.
When I pass an invoice and dunsnumber from the file and debug the program
the %Equal() after the Setll has a value of '0' indicating an exact
match
was not found. I check the file and yes the record does exist. I also
tested this with SQL adding the invoice number and dunsnumber passed to
the
program and the record was returned.

I'm stumped...any ideas?

One more thing, if I change the key to only the invoice it works.

Setll invoiceIn EDII810JH4;
rc = %Equal();
Reade invoiceIn EDII810JH4;

Thanks all,

Rob
--
This is the RPG programming on the IBM i / System i (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 IBM i / System i (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-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.