View previous topic :: View next topic
|
Author |
Message |
dipanshu
New User
Joined: 16 Jan 2006 Posts: 53 Location: pune
|
|
|
|
READ FILE1
AT END
MOVE 'NO' TO ARE-THER-MOR-RECS
NOT AT END
PERFORM CHK-STATUS
Confusion - If the file is empty will it execute (chk-status para) ie not-end part
Pls assist |
|
Back to top |
|
|
Rupesh.Kothari
Member of the Month
Joined: 27 Apr 2005 Posts: 463
|
|
|
|
HI,
Quote: |
READ FILE1
AT END
MOVE 'NO' TO ARE-THER-MOR-RECS
NOT AT END
PERFORM CHK-STATUS
Confusion - If the file is empty will it execute (chk-status para) ie not-end part |
If file is empty then it will not execute CHK-STATUS
Hope this helps
Regards
Rupesh |
|
Back to top |
|
|
umeshkmrsh
New User
Joined: 21 Sep 2005 Posts: 79 Location: India
|
|
|
|
umeshkmrsh wrote: |
It will not execute CHK-STATUS. |
|
|
Back to top |
|
|
priti
New User
Joined: 29 Sep 2005 Posts: 3
|
|
|
|
The file being empty, the 'AT END ' clause will be executed |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi,
There are 2 kinds of empty:
1) If the file was never opened/closed, it is uninitialized and not a valid file.
2) If it was opened/closed but never written to, it is a valid file with no records.
In the 1st instance, if you attempt to open the file, it will produce an error.
In the 2nd, the open is successful and the 1st read produces an EOF condition. |
|
Back to top |
|
|
|