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
 
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 Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 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 BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm

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