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

Why can't we delete a record in sequential files


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Mon May 16, 2005 5:54 pm
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
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: 84
Location: In my tiny cubicle ...

PostPosted: Wed May 18, 2005 7:33 pm
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts DELETE SPUFI DB2 1
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top