View previous topic :: View next topic
|
Author |
Message |
bala-lakshmi
New User
Joined: 01 Mar 2004 Posts: 6
|
|
|
|
hai friends,
please tell me how to delete a particular record from a sequential file .organization is sequential,access mode is sequential
bye
lakshmi  |
|
Back to top |
|
 |
anuradha
Active User

Joined: 06 Jan 2004 Posts: 247 Location: Hyderabad
|
|
|
|
hi lakshmi,
In a sequential file we cant delete any record directly.AFAIK read the file until that particular record is found and delete it.That is the only way i hope.
THANKS AND REGARDS
ANU |
|
Back to top |
|
 |
bala-lakshmi
New User
Joined: 01 Mar 2004 Posts: 6
|
|
|
|
HAI ANU,
WE CAN NEVER DELETE A RECORD FROM A SEQUENTIAL FILE.
BUT SUPPOSE I DON'T WANT A RECORD SAY IF I HAVE 10 RECORDS
I DON'T WANT THE 7 RECORD THEN HOW WILL I DELETE ?
PLEASE TELL ME WITH A PROGRAM
BYE
LAKSHMI  |
|
Back to top |
|
 |
bluebird
Active User
.jpg)
Joined: 03 Feb 2004 Posts: 127
|
|
|
|
hello,
the only way I can think of :
prepare a pgm that will have your seq file as input and a new temporary file (coded &&file with disp=(new,pass)) in your JCL
pgm will read and copy records you want in your temporary file
subsequent steps will 1 delete your seq file then recreate your seq file from temp file.
hope it helps |
|
Back to top |
|
 |
sandip_datta
Active User

Joined: 02 Dec 2003 Posts: 150 Location: Tokyo, Japan
|
|
|
|
In addition to bluebird's post,
We can use SORT with SKIP option to copy records selectively, provided the skip conditions are not that much complex. |
|
Back to top |
|
 |
mmwife
Super Moderator

Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi lakshmi,
Your question should have been addressed in the design phase of the project.
If the file contained a "delete byte" that is turned "on" when the record is "deleted", you accomplish your objective. If space becomes a problem you can use SORT to recreate the file, dropping the "deleted" recs.
Regards, Jack. |
|
Back to top |
|
 |
kappurajesh Currently Banned New User
Joined: 03 Apr 2004 Posts: 4 Location: India
|
|
|
|
We can delete 7th record for that we have to create two sequential files with same structure , if count the records, if it is 7th , don't write to second seq. file else write it. And transfer to first seq file |
|
Back to top |
|
 |
|