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 Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 3 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


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