View previous topic :: View next topic
|
Author |
Message |
raviprabhu
New User
Joined: 20 Oct 2006 Posts: 29
|
|
|
|
Code: |
START FILE-XXXX KEY IS >= WS-BUILD-Key
PERFORM UNTIL WS-EOF = 'Y'
DISPLAY '0220-READ-FILE'
READ FILE-TEMP
AT END MOVE 'Y' TO WS-EOF
NOT AT END
MOVE FILE-TEMP-XXX TO P-XXX-REC
END-READ
END-PERFORM. |
Whats wrong with above statement?
The code is going in loop, the display ''0220-READ-FILE' is showing in loops.
Please help here. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Please use Code tags. Did you check the file status after your START? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
If file-temp is read by a key and the key is not ever changed, it will read that record forever . . . |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
Maybe you meant READ NEXT instead of READ? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Good point Terry.
EVERY read/write/whatever should be followed by checking the file status. |
|
Back to top |
|
|
raviprabhu
New User
Joined: 20 Oct 2006 Posts: 29
|
|
|
|
thanks this works with next record |
|
Back to top |
|
|
Phrzby Phil
Senior Member
Joined: 31 Oct 2006 Posts: 1042 Location: Richmond, Virginia
|
|
|
|
I wonder if this READ sans NEXT but with a NOT AT END clause generated a warning. |
|
Back to top |
|
|
|