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

How can delete a sequential file which has 1 millon records


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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: 2358
Location: Israel

PostPosted: Tue Nov 07, 2006 11:45 am
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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
Search our Forums:

Back to Top