Empty out the Dataset



IBM's Command List programming language & Restructured Extended Executor

Empty out the Dataset

Postby fornanthakumar » Tue Dec 14, 2010 5:54 am

Hi,

I want to delete records from datasets. (ie) To empty out the dataset.

Is it possible through REXX.
Regards,
Nanthu.Y.
fornanthakumar
 
Posts: 69
Joined: Fri Oct 22, 2010 1:58 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Empty out the Dataset

Postby MrSpock » Tue Dec 14, 2010 7:39 am

The only way I know of is to open the dataset, push a single empty string, and then write the one record and close the file:

/* REXX */
"EXECIO 0 DISKR i"
Push ""
"EXECIO 1 DISKW i (FINIS"
Exit 0
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times

Re: Empty out the Dataset

Postby NicC » Tue Dec 14, 2010 10:38 am

Or have your exec open the dataset in edit, delete all the records and then close.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Empty out the Dataset

Postby steve-myers » Wed Dec 15, 2010 10:57 am

MrSpock and NicC describe "emptying" a sequential data set. You have to use other methods to "empty" other types of data sets. The method discussed by MrSpock is probably the safest technique, but that's just my personal opinion.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: Empty out the Dataset

Postby dick scherrer » Thu Dec 16, 2010 1:40 am

Hello,

Why does someone believe these datasets need to be "empty"?
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Empty out the Dataset

Postby MFSlearner » Fri Dec 17, 2010 2:30 am

The below Rexx code also deletes all the records from a dataset:

address tso
"alloc dd(infile) da('userid.SUPERC.LIST') shr reuse"
"execio 0 diskw infile (open finis"
"free dd(infile)"
MFSlearner
 
Posts: 4
Joined: Wed Nov 17, 2010 8:09 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Empty out the Dataset

Postby dick scherrer » Fri Dec 17, 2010 2:54 am

Hello,

The below Rexx code also deletes all the records from a dataset
Well, from some of them anyway. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Empty out the Dataset

Postby Pedro » Sat Dec 18, 2010 10:49 pm

Or have your exec open the dataset in edit, delete all the records and then close.

It will work but, compared to just using simple I/O instructions, will use tremendous overhead (need ISPF environment, reading all the records, managing virtual storage, etc...). You should try both and measure the system resources used in each case.
Pedro Vera
User avatar
Pedro
 
Posts: 686
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: Empty out the Dataset

Postby NicC » Sun Dec 19, 2010 1:08 am

The only way I know of is to open the dataset, push a single empty string, and then write the one record and close the file:


But that does not empty the file - it still leaves the line that you PUSHed and wrote. (I just got round to trying it)
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Empty out the Dataset

Postby steve-myers » Sun Dec 19, 2010 5:27 am

It seems to me fornanthakumar wants a data security erase program. There are two possibilities: one that is good enough, the other meets United States Department of Defense requirements.

The solutions that have been proposed here effectively remove the records from the first track and most likely the second track. None of the remaining tracks will be touched, though it will be difficult for most of us to get to them. These solutions represent what can be reliably accomplished using Rexx.

I'm not sure it is possible to meet Department of Defense requirements with modern RAID based DASD, though a good enough solution will work fine. It's just a guess, but I think you'd have to remove every commodity hard drive in the RAID array, plug them into PC that can handle them, and then run a program tailored to the hard drive that will erase the hard drive to Department of Defense requirements. This, of course will erase the entire RAID.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Next

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post