Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us