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

deleting a record in a sequential file


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
bala-lakshmi

New User


Joined: 01 Mar 2004
Posts: 6

PostPosted: Tue Mar 16, 2004 2:36 pm
Reply with quote

hai friends,
please tell me how to delete a particular record from a sequential file .organization is sequential,access mode is sequential
bye
lakshmi icon_lol.gif
Back to top
View user's profile Send private message
anuradha

Active User


Joined: 06 Jan 2004
Posts: 247
Location: Hyderabad

PostPosted: Tue Mar 16, 2004 4:46 pm
Reply with quote

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
View user's profile Send private message
bala-lakshmi

New User


Joined: 01 Mar 2004
Posts: 6

PostPosted: Tue Mar 16, 2004 5:14 pm
Reply with quote

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 icon_lol.gif
Back to top
View user's profile Send private message
bluebird

Active User


Joined: 03 Feb 2004
Posts: 127

PostPosted: Tue Mar 16, 2004 7:16 pm
Reply with quote

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
View user's profile Send private message
sandip_datta

Active User


Joined: 02 Dec 2003
Posts: 150
Location: Tokyo, Japan

PostPosted: Wed Mar 24, 2004 12:33 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Mar 26, 2004 10:00 am
Reply with quote

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
View user's profile Send private message
kappurajesh
Currently Banned

New User


Joined: 03 Apr 2004
Posts: 4
Location: India

PostPosted: Mon Apr 26, 2004 7:37 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top