SETLL READE not working?

145 pts.
Tags:
RPGLE SETLL READE
I am using a partial key (1st field) to read a keyed file (2 fields - both keys - ascending order):

ABCKEY      KLIST                  KFLD          WRKABC  (this has a value that I know has at least 1 record in my external file)                                                                          (indicators)

C                ABCKEY         SETLL       FILE               506070

C                ABCKEY         READE      FILE                   8090

C                *IN90           DOWEQ    *OFF C                                  

 :

I added the indicators on both the SETLL and READE (initially only had 90 in EQ indicator) to see where the problem was.  I know for a fact that my WRKABC field has a value that has several records in my FILE.  When I debug my program, after the SETLL, 50, 60 and 70 are off.  (Shouldn't 70 be on?) After the READE - 90 is on, but I think should be off.  When I look to see what record it is reading, it is pointing at the first record AFTER this match: Example:  WRKABC = 'A1234' FILE has: A1234  12847258 A1234  38356738 A1234  49384678 A1234  78793867 A1235  94849687  <---- job shows it is on this record Any idea what is happening? I am concerned because we have several existing programs that use these 2 operations.  



Software/Hardware used:
Iseries OS = V6R1M0
ASKED: December 8, 2011  8:10 PM
UPDATED: February 28, 2012  3:23 PM

Answer Wiki

Thanks. We'll let you know when a new response is added.

I figured out the problem. It was my data. In my FILE, my field is defined as 7A, but the value I am searching on is only 5 char. For some reason, when I transferred my data into the file, pos 6 of that field was not a 40. So, in hex, it didn’t match up.

Discuss This Question: 7  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • philpl1jb
    Silly question -- but it's all I got ABCKEY only has one KFLD defined? Phil
    48,575 pointsBadges:
    report
  • Pt0505
    I read FILE twice using 2 keys - once with just 1 field, then again with both. I assign different hold codes based on 2 scenarios.
    145 pointsBadges:
    report
  • philpl1jb
    And the ABCKEY has only one KFLD?
    48,575 pointsBadges:
    report
  • Pt0505
    I did update the question earlier today. It was a data issue. Can you see my answer? To answer your question, yes. I have 2 keys - one has only 1 field in it (1st in the file); 2nd key has both fields in it (they match the 2 fields in my file).
    145 pointsBadges:
    report
  • TomLiotta
    C                ABCKEY         SETLL       FILE               506070 
    For that line of code under the circumstances that you describe in your 'answer', it makes sense that none of the indicators came on. I was going to ask about the definitions of the fields because there seemed to be only one possibility -- that WRKABC was not a 5-character field. *IN50 didn't come on because the search key value was not "greater than the highest key or relative record number in the file." *IN60 didn't come on because there was no error. *IN70 didn't come on because the search key didn't match an actual key in the file. Then for the READE, *IN90 came on because the key of the record it was positioned on was greater than the search key. Your finding that non-blank characters existed in the key fields fits everything. Good job tracking it down. Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    Thanks for the feedback. Phil
    48,575 pointsBadges:
    report
  • BigKat
    yes, good job tracking it down, and especially for coming back and updating us with what you discovered. :)
    7,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following