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
 

 

How can delete a sequential file which has 1 millon records

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

New User


Joined: 22 May 2005
Posts: 7
Location: Bangalore

PostPosted: Tue Nov 07, 2006 11:39 am    Post subject: How can delete a sequential file which has 1 millon records
Reply with quote

Hi
i am sasi,

one interviewer asked these question , please answer it , it will be more help for me
1. how can delete a sequential file which has 1 millon records, through the cobol programming ?

2.can i delete a record in sequential file ?

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

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Nov 07, 2006 11:45 am    Post subject:
Reply with quote

1. If I had to delete a dataset from a COBOL program (why????), I would probably code TSO commands from COBOL (Either TSO's DELETE or through IDCAMS).

2. As far as I know, you can't delete a record from a sequential file programmatically. You will have to rewrite the file without the desired record. However, if the file is not too big, you can use ISPF's Edit-Macro commands (even from within COBOL) to delete a single record.

O.
Back to top
View user's profile Send private message
samayamsasi
Warnings : 1

New User


Joined: 22 May 2005
Posts: 7
Location: Bangalore

PostPosted: Tue Nov 07, 2006 12:31 pm    Post subject: Re: need info on equential file ?
Reply with quote

Hi Rj, ofer

thx for ur replies
we can delete sequential file physical ( by idcams or thorugh 3.4 options)
my question is, is it possible delete a sequential file through the cobol programming ?

Sasi
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Nov 10, 2006 5:39 am    Post subject:
Reply with quote

You can delete all the recs in the file by opening it for output and closing it immediately.
Back to top
View user's profile Send private message
prashanth1

New User


Joined: 27 Sep 2006
Posts: 47
Location: Hyderabad

PostPosted: Fri Nov 10, 2006 10:42 am    Post subject:
Reply with quote

mmwife,

means that, do we need to use (OLD,DELETE,DELETE) as the DISP parameters in JCL.



Pls Correct Me ,IF I wrong icon_smile.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Nov 11, 2006 6:33 am    Post subject:
Reply with quote

Hi Prashanth,

I have a feeling (because of the wording) the ques was intended to mean delete all 1 mil recs, not the file.

To delete the file you don't need a COBOL pgm. Just use IEFBR14 with a DD that contains disp=(old,delete,delete) as you suggested.

But, then I wasn't there. icon_smile.gif
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Nov 12, 2006 10:16 pm    Post subject:
Reply with quote

'Sfunny, you can delete ALL the recs in a seq file, but you can't delete just one. icon_smile.gif

Yeah, yeah; I know.
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 RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm


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