View previous topic :: View next topic |
Author |
Message |
arvibala Beginner
![](images/avatars/gallery/misc/Dis115.gif)
Joined: 12 Feb 2008 Posts: 142 Topics: 67
|
Posted: Tue Aug 10, 2010 4:31 am Post subject: Cobol Interview Question |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Aug 10, 2010 5:44 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
vkphani Intermediate
![](images/avatars/gallery/cartoons/WB03.gif)
Joined: 05 Sep 2003 Posts: 483 Topics: 48
|
Posted: Tue Aug 10, 2010 6:59 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Aug 10, 2010 7:28 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
arvibala Beginner
![](images/avatars/gallery/misc/Dis115.gif)
Joined: 12 Feb 2008 Posts: 142 Topics: 67
|
Posted: Wed Aug 11, 2010 8:57 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Wed Aug 11, 2010 9:46 am Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
papadi Supermod
Joined: 20 Oct 2009 Posts: 594 Topics: 1
|
Posted: Wed Aug 11, 2010 6:02 pm Post subject: |
|
|
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 |
|
![](templates/subSilver/images/spacer.gif) |
|
|