Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Why can't we delete a record in sequential files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
machswap

New User


Joined: 19 Apr 2005
Posts: 14

PostPosted: Mon May 16, 2005 3:49 pm    Post subject: Why can't we delete a record in sequential files
Reply with quote

Hi,

Why can't we delete a record in sequential files.

Thanks
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Mon May 16, 2005 5:54 pm    Post subject: Re: Why cant we delete a record in sequential files
Reply with quote

You can. What has lead you to think otherwise?
Back to top
View user's profile Send private message
machswap

New User


Joined: 19 Apr 2005
Posts: 14

PostPosted: Wed May 18, 2005 7:09 pm    Post subject: Re: Why cant we delete a record in sequential files
Reply with quote

superk wrote:
You can. What has lead you to think otherwise?


Hi,

How can u delete a record physically.
if u delete a particular record it will still be there but will be empty..either spaces or zeroes.

is physical deletion possible;

eg.
input records - 100
after deltetion of one record- 99
Back to top
View user's profile Send private message
Prandip

New User


Joined: 04 Mar 2005
Posts: 85
Location: In my tiny cubicle ...

PostPosted: Wed May 18, 2005 7:33 pm    Post subject: Re: Why can't we delete a record in sequential files
Reply with quote

As far as I know, the technique has always been the same:

- Read the file and write out each record to be kept.

- Once the record to be deleted has been reached, skip writing it.

- Continue reading and writing until the end-of-file is reached.

The resulting file should have one less record then the original.
Back to top
View user's profile Send private message
Ravi Kiran

New User


Joined: 24 May 2005
Posts: 1

PostPosted: Mon May 30, 2005 2:59 pm    Post subject: Re: Why can't we delete a record in sequential files
Reply with quote

we cannot delete a record in sequential files coz all the sequential records are chained even though they dont have an index component. The last 2 bytes of every record contains the address of the previous record and so delettion of one particular record is not possible as it contains the address of another record.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Tue May 31, 2005 1:28 am    Post subject:
Reply with quote

The ans is because the function wasn't provided. The function wasn't provided, probably, because it was a dumb idea. How would they "physically" delete them? Would they leave a "hole" where the rec used to be? Or do they relocate all the recs following the "deleted" rec to fill in the "hole"?

Generally PS files are processed (and recreated) in cycles, so the current cycle usually "deletes" the unwanted recs.

As Superk alluded, PS recs can be "deleted" logically using pgm logic or by recreating the file w/o the undesired recs. Sounds like a plan to me.

BTW, Ravi, PS file recs aren't chained and there are no control bytes following each rec. Generally on DA devices there is a home address at the beginning of each track. Recs (blocks) on the track are found by detecting the IRGs (Inter Record Gaps) between blocks. The blocks are passed to I/O routines that fill the buffers for use by the Access Method that, in turn, retrieves the record for use by the pgm.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Record Not found in AlX but record re... mukun264 COBOL Programming 7 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us