View previous topic :: View next topic
|
Author |
Message |
Purnendu.it
New User
Joined: 11 May 2007 Posts: 57 Location: chennai
|
|
|
|
Hi all,
can u tell me what is the difference between logical end of file and physical
end of file? |
|
Back to top |
|
|
balakrishna reddy
Active User
Joined: 13 Jul 2007 Posts: 128 Location: Guntur
|
|
|
|
hi purnendu,
A Logical File is just an index over a file. The Logical File does not contain the actual data. The Logical File only references the data in the Physical file. The best way to think of an Logical File, it contains the key and a pointer to the corresponding record in the physical file. |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Hey whiz kid, learn to read, logical vs physical EOF........
My guess would be the case of reaching a point in the file where you know that there are no more records that apply.... |
|
Back to top |
|
|
Purnendu.it
New User
Joined: 11 May 2007 Posts: 57 Location: chennai
|
|
|
|
hi cics guy,
can you say more specifically the answer of the question i asked? |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Purnendu.it wrote: |
can you say more specifically the answer of the question i asked? |
Can you more specifically ask the question?
In what context are you refering to logical vs physical EOF? |
|
Back to top |
|
|
Purnendu.it
New User
Joined: 11 May 2007 Posts: 57 Location: chennai
|
|
|
|
Hi,
i mean to say how can we differentiate between a logical end of file
to a physical eof in cobol.let us take in that way in a same file
how can we differentiate a logical eof to a phsysical eof?am i clear this time? |
|
Back to top |
|
|
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 2146 Location: At my coffee table
|
|
|
|
Clear? Not really.....
To me, physical is where the media declares EOF and logical is where you declare EOF....
For instance, a customer file alphabetically sorted by last name, a report of all customers vs a report of customers whose name begins with the letter "F".....
The first would read to physical EOF while the second would "declare" logical EOF when a customer whose name begins with a letter greater than "F" is read..... |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
can u tell me what is the difference between logical end of file and physical end of file? |
Let's say you have a sequential file. Let's also say that it will be read by a COBOL program. When a READ raises the AT END condition, the process has reached both the logical and physical end-of-file.
If this not what you are looking for, please clarify what you are looking for. |
|
Back to top |
|
|
Purnendu.it
New User
Joined: 11 May 2007 Posts: 57 Location: chennai
|
|
|
|
hi Dick,
Quote: |
When a READ raises the AT END condition, the process has reached both the logical and physical end-of-file.
|
suppose while declaring file i have declared the a large no. of space for
the file in 3.2 option.let us say its 20000 kb .But while inserting record
i have inserted only few records say 3 records.
Now logical end of file will be at third record.But physically this file
can have more data than that.because its space is too large.So in this
case also both eof will be the same.if it is?what about the all spaces.I thought physically file should be very large than to holding only three
records.Am i clear?please let me know and clear my doubts.
thanks |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
For this
Purnendu.it wrote: |
let us say its 20000 kb .But while inserting record
i have inserted only few records say 3 records. |
You wanted to say (perhaps), one record is of 1 KB & there are only 3 records in file while file's DCB says it can contain 20,000 records. If so Dick's explanation if fair enough
Quote: |
Let's say you have a sequential file. Let's also say that it will be read by a COBOL program. When a READ raises the AT END condition, the process has reached both the logical and physical end-of-file. |
Further
Purnendu.it wrote: |
Now logical end of file will be at third record. |
Here your records ends..& if they exist ..they also exists physically, so this
Quote: |
But physically this file can have more data than that. because its space is too large. So in this case also both eof will be the same.if it is? |
Yes, both will happen at the same time. READ verb is intelligent enough to understand that is no more record is there in the file so stop furher reading.
The word 'physical' comes into the picture only when you are talking about the DASD/TAPE usage, for READ verb point of view physical or logical EOF, per your example, are same. |
|
Back to top |
|
|
Purnendu.it
New User
Joined: 11 May 2007 Posts: 57 Location: chennai
|
|
|
|
HI dick and Anuj,
Thanks for the explanation.But then it means that there is no difference
between logical and physical end of file.
Quote: |
Let's say you have a sequential file. Let's also say that it will be read by a COBOL program. When a READ raises the AT END condition, the process has reached both the logical and physical end-of-file.
|
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6248 Location: Mumbai, India
|
|
|
|
Hi,
If you'll provide the definitions of 'Logical EOF' & "Physical EOF" from your poinr of view, may be some one here be able to explain more better. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
But then it means that there is no difference
between logical and physical end of file |
Yes. In your cobol program, you will not be able to tell one from the other when you open the file sequentially and read from it. AT END is the end and you will not know if there is wasted (unused) space in the file allocation. Of course, there is no need to know this inside the program. |
|
Back to top |
|
|
Purnendu.it
New User
Joined: 11 May 2007 Posts: 57 Location: chennai
|
|
|
|
HI dick,
Thanks for the explanation.I suppose the exact answer should be
there is no difference bet both if we consider it from programming(Let say
Cobol) point of view.So on what aspect we can have differences
between these two.I guess there must have been some difference
on some aspects.I hope you got my question.
Thanks in advance.
I guess i am making that discussion a little more complex by going
too much inside it.If it is like that then sorry in advance. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I guess i am making that discussion a little more complex by going
too much inside it.If it is like that then sorry in advance. |
Not to worry It is good to learn these things.
Quote: |
I guess there must have been some difference
on some aspects |
One difference can be wasted space. If your data will need 10 tracks and the allocation is 100 cyls, everything will run fine, but almost all of the 100 cyls is wasted. When you program reads the EOF after 10 tracks it will raise the AT END and the other space will not be referenced. |
|
Back to top |
|
|
|