IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Diff between logical eof and physical eof


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Tue Sep 11, 2007 2:39 pm
Reply with quote

Hi all,
can u tell me what is the difference between logical end of file and physical
end of file? icon_biggrin.gif
Back to top
View user's profile Send private message
balakrishna reddy

Active User


Joined: 13 Jul 2007
Posts: 128
Location: Guntur

PostPosted: Tue Sep 11, 2007 2:49 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Sep 11, 2007 2:59 pm
Reply with quote

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
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Tue Sep 11, 2007 3:13 pm
Reply with quote

hi cics guy,

can you say more specifically the answer of the question i asked?
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Sep 11, 2007 3:34 pm
Reply with quote

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
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Tue Sep 11, 2007 3:50 pm
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Sep 11, 2007 4:02 pm
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Tue Sep 11, 2007 7:42 pm
Reply with quote

Hi,

This post might help further.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Sep 11, 2007 8:19 pm
Reply with quote

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
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Wed Sep 12, 2007 11:14 am
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Sep 12, 2007 1:35 pm
Reply with quote

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
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Wed Sep 12, 2007 2:27 pm
Reply with quote

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.
icon_smile.gif
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Wed Sep 12, 2007 4:02 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Sep 12, 2007 6:28 pm
Reply with quote

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
View user's profile Send private message
Purnendu.it

New User


Joined: 11 May 2007
Posts: 57
Location: chennai

PostPosted: Mon Sep 17, 2007 6:44 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Sep 17, 2007 7:22 pm
Reply with quote

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 icon_smile.gif 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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Rotate partition-logical & physic... DB2 0
No new posts How to list BMS MAP screens in BMS Ph... CICS 2
No new posts how to show listing in physical locat... PL/I & Assembler 2
No new posts Sort on different fields, removing du... SYNCSORT 8
No new posts How to get the Physical terminal name IMS DB/DC 0
Search our Forums:

Back to Top