MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Cobol Interview Question

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Interview Q & A
View previous topic :: View next topic  
Author Message
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Tue Aug 10, 2010 4:31 am    Post subject: Cobol Interview Question Reply with quote

Why is Cobol designed to READ FROM A FILE and WRITE TO A RECORD?
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Aug 10, 2010 5:44 am    Post subject: Reply with quote

because multiple record definitions are allowed for an FD.
since they all start at the same address, there is no need to declare into which record to read a file.

but, since multiple records can be defined for a file, in order to have the proper length record written, we need to declare from which record a file is written.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
vkphani
Intermediate


Joined: 05 Sep 2003
Posts: 483
Topics: 48

PostPosted: Tue Aug 10, 2010 6:59 am    Post subject: Reply with quote

There is something called as record id. A file can contain multiple records and while writing to an output file, this record id is taken into consideration. If not, records are overwritten.
Back to top
View user's profile Send private message Send e-mail
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Tue Aug 10, 2010 7:28 am    Post subject: Reply with quote

vkphani wrote:
There is something called as record id. A file can contain multiple records and while writing to an output file, this record id is taken into consideration. If not, records are overwritten.


puhleeesse elaborate.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
arvibala
Beginner


Joined: 12 Feb 2008
Posts: 142
Topics: 67

PostPosted: Wed Aug 11, 2010 8:57 am    Post subject: Reply with quote

Thanks Brenholtz,

I got many answers and urs makes lot of sense. I tried to search and none of the books or Online tutorials have this explaination. But I guess this is a good question.
Thanks Again
_________________
Arvind
"You can make a difference with your smile. Have that with you always"
Back to top
View user's profile Send private message Yahoo Messenger
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Aug 11, 2010 9:46 am    Post subject: Reply with quote

actually, the answer is: because that is the syntax.

I have never found the explanation I provided,
but it makes sense to me.
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
papadi
Supermod


Joined: 20 Oct 2009
Posts: 594
Topics: 1

PostPosted: Wed Aug 11, 2010 6:02 pm    Post subject: Reply with quote

Another thought:
We read a file because we don't know before the read if there even is a record to be read.
_________________
All the best,

di
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Interview Q & A All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group