SETLL & DOU

95 pts.
Tags:
AS/400
SETLL
When I use SETLL and DOU , the loop is being executed only once. I am not able to process the next records. My actual code is @Key Setll File1 DoU %EoF Read File1 If ......... EndIf Enddo After reading 1st record it is coming out of loop. Please anyone help me.

Software/Hardware used:
software

Answer Wiki

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

Hi NanAS400, @KEY  in SETLL is pointing to the EOF . Key has the value which is making EOF to be true that’s why it is coming out of the loop.  and you are using DOU – DO until which always run first time without checking the condition.

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
    @Key Setll File1 DoU %EoF Read File1 If ......... EndIf Enddo
    50,205 pointsBadges:
    report
  • philpl1jb
    So many issues, so little time... 1. if you only want to process for a single key then use READE 2. Use file name in EOF function .. it assure you that the correct file is being tested 3. I would use a primary read and only enter the loop if a record was available. @Key Setll File1 @Key Reade File1 DoW not %EoF(File1) do stuff @Key Reade File1 Enddo
    50,205 pointsBadges:
    report
  • NAN4AS400
    hi, why i am using this DOU is in my If & EndIf i have an iter statement. when i placed an Iter it is not reading next record. So i have changed from DOW to DOU...
    95 pointsBadges:
    report
  • NAN4AS400
    Thanks dude... It worked when i gave Record format name after my %EOF. Have a Great Day :) NAN
    95 pointsBadges:
    report
  • philpl1jb
    You want to thank me for helping you use Iter? "I don't deserve this award, but I have arthritis and I don't deserve that either." Jack Benny
    50,205 pointsBadges:
    report
  • TomLiotta
    Without seeing the code between your IF and ENDIF statements, we don't know why it didn't work without the record format name. But we can make guesses. . For example, there might be other I-O statements that run in your hidden code and they could be setting the %EOF function on. When you put a record format name in the function, it becomes limited to that file format. . But that's a guess. It does explain the behavior though. . Tom
    125,585 pointsBadges:
    report
  • philpl1jb
    It's a matter of style, ITER and LEAVE don't conform to the rules of structured programming.
    50,205 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