Page 2 of 3

Re: Empty out the Dataset

PostPosted: Mon Dec 20, 2010 8:30 pm
by Pedro
... wants a data security erase program.

I have never used this, but RACF has an ERASE option. Use the ALTDSD command with ERASE option to make the system erase the records in the dataset:

ERASE
Specifies that when SETROPTS ERASE is active, data
management is to physically erase the contents of deleted
data sets and scratched or released DASD extents. Erasing
the data set means overwriting its contents with binary
zeroes so that it cannot be read.


I'm not sure it is possible to meet ....

I trust system provided services more than adhoc tools.

Re: Empty out the Dataset

PostPosted: Mon Dec 20, 2010 8:46 pm
by enrico-sorichetti
looks like y' all are just wasting time, the TS just dropped a silly question and disappeared
I wonder why REXX and not simple iebgener with a dummy sysut1
almost time to lock the topic and delete it in a couple of days :D

Re: Empty out the Dataset

PostPosted: Tue Dec 21, 2010 1:34 am
by steve-myers
IEBGENER with a dummy SYSUT1 will effectively erase the first (and possibly the second) track, and make it difficult for most programs to access the remaining tracks. I don't think the original question is silly; it was worded poorly.

One of the things I've always found odd (at least since I was smart enough to analyze it) about data management is it drops a DASD "EOF" record as the first record of the next track after the last record of a sequential data set. I suspect they do it this way because they don't have to worry about doing track capacity analysis to make sure the "EOF" record can be written, and also to make data sets using maximum length records consistent with data sets with shorter records.

I prepared and ran this JCL
//A       EXEC PGM=IEFBR14
//DS1      DD  DISP=(MOD,DELETE),UNIT=SYSALLDA,SPACE=(TRK,0),
//             DSN=&SYSUID..TESTEOF.DS1
//DS2      DD  DISP=(MOD,DELETE),UNIT=SYSALLDA,SPACE=(TRK,0),
//             DSN=&SYSUID..TESTEOF.DS2
//DS3      DD  DISP=(MOD,DELETE),UNIT=SYSALLDA,SPACE=(TRK,0),
//             DSN=&SYSUID..TESTEOF.DS3
//DS4      DD  DISP=(MOD,DELETE),UNIT=SYSALLDA,SPACE=(TRK,0),
//             DSN=&SYSUID..TESTEOF.DS4
//DS1     EXEC PGM=IEBGENER
//SYSPRINT DD  DUMMY
//SYSUT1   DD  DUMMY,DCB=(RECFM=FB,LRECL=80,BLKSIZE=80)
//SYSUT2   DD  DISP=(,CATLG),UNIT=SYSDA,SPACE=(TRK,1),DSN=*.A.DS1
//SYSIN    DD  DUMMY
//DS2     EXEC PGM=IEBGENER
//SYSPRINT DD  DUMMY
//SYSUT1   DD  DUMMY,DCB=(RECFM=FB,LRECL=80,BLKSIZE=80)
//SYSUT2   DD  DISP=(,CATLG),UNIT=SYSDA,SPACE=(TRK,2),DSN=*.A.DS2
//SYSIN    DD  DUMMY
//DS3     EXEC PGM=IEBGENER
//SYSPRINT DD  DUMMY
//SYSUT1   DD  DUMMY,DCB=(RECFM=FB,LRECL=80,BLKSIZE=80)
//SYSUT2   DD  DISP=(,CATLG),UNIT=SYSDA,SPACE=(TRK,3),DSN=*.A.DS3
//SYSIN    DD  DUMMY
//DS4     EXEC PGM=IEBGENER
//SYSPRINT DD  DUMMY
//SYSUT1   DD  DUMMY,DCB=(RECFM=FB,LRECL=80,BLKSIZE=80)
//SYSUT2   DD  DISP=(,CATLG),UNIT=SYSDA,SPACE=(TRK,4),DSN=*.A.DS4
//SYSIN    DD  DUMMY
I then performed an image dump of each data set, and got these results.
  • DS1 - An "EOF" record on the one track
  • DS2 - An "EOF" on the first track, junk on the remaining tracks
  • DS3 - An "EOF" on all 3 tracks
  • DS4 - An "EOF" on the first 2 tracks, junk on the third and fourth tracks.
A little primer about writing to DASD. There are two different types of write commands for DASD that ordinary programs that use EXCP can use: update writes, to alter an existing record, and formatting writes to create a new record. A formatting write command at the end of a channel program erases the track after the new record; any data that was on the track disappears after a formatting write. Programs that initialize DASD can do formatting writes for two additional record types: the "home address" record at the beginning of a track, and the record 0, also at the beginning of a track. An "EOF" record can be written by any program that uses EXCP.

Re: Empty out the Dataset

PostPosted: Tue Dec 21, 2010 1:40 am
by enrico-sorichetti
To empty out the dataset.

if we had to take a poll most people would agree on
do something in order to get an EOF condition on the first read ( in other words write an EOF and forget about it )

Re: Empty out the Dataset

PostPosted: Tue Dec 21, 2010 10:33 am
by NicC
if we had to take a poll most people would agree on
do something in order to get an EOF condition on the first read ( in other words write an EOF and forget about it )


We will probably never find out as OP has not come back at any point - not even to say 'Thank you'

Re: Empty out the Dataset

PostPosted: Sat Dec 25, 2010 6:14 am
by fornanthakumar
Hi Steve & All,

Merry christmas to all. Have the time of your life today.

Better i will delete all the records manually instead of doing the crap as mentioned by you.. Just kidding... :lol: :lol: :lol: :P

I want just want to automate it... just got strike of doing it in REXX.. so posted..

i got so many options.. i can go with MFslearner .. its working too...

If anyother efficient you have then please post that ...

Re: Empty out the Dataset

PostPosted: Sat Dec 25, 2010 11:11 am
by dick scherrer
Hello,

The most efficient way i know to "empty" a dataset is to simply open it as output and close it.

If some kind of dummy record is needed, create a dummy record in another file and copy that dummy record to the dataset you want to be "empty".

In either case, there should be no concern about efficiency as the amount of work to be done is so small.

Re: Empty out the Dataset

PostPosted: Sat Dec 25, 2010 2:54 pm
by enrico-sorichetti
Better i will delete all the records manually instead of doing the crap as mentioned by you.


what is that You want exactly! since the crappy way You posted your question does not tell? (*)

1) overwrite all the datasets extent in order to make a bit more difficult to find out what was there
2) write and EOF record in order to make it look like it has no records in it

for case 1 the best solution is to use the facilities of Your security product
for case 2 no need for REXX or anything else, it has been done everywhere for ages with a IEBGENER

for IEBGENER You just have to write the JCL/no control cards nor anything else
for REXX/OPEN-CLOSE/OTHER UTILITIES same as above + REXX SCRIPT/ PROGRAM/UTILITY CONTROL CARDS
so globally IEBGENER is the most effective and efficient solution

(*)before criticizing the answers learn how to ask questions fulls stop :evil:

Re: Empty out the Dataset

PostPosted: Sun Dec 26, 2010 1:10 am
by steve-myers
fornanthakumar wrote:... Better i will delete all the records manually ...

I'm not sure what you mean by "delete." If you mean to edit the data set and delete all the records (using, for example DEL ALL NX in the ISPF command line) then save the dataset, the solutions using IEBGENER to write an empty data set are much more efficient and will produce the same results. If you mean to alter all of the records to some sort of meaningless data, I don't have any sort of solution. If you mean to "delete" records as a program can do with VSAM KSDS datasets, it won't do what you think it will. These "deleted" records are flagged so that VSAM won't return them if you try to read the record, but most of the data remains intact and can be read by programs that know how to read VSAM "deleted" data. These records will be deleted when the dataset is copied, but that's not what you're thinking about, and the partially "deleted" records will still be present.

You can specify ERASE using the ADDSD or ALTDSD RACF commands, or in the DEFINE CLUSTER or ALTER IDCAMS commands, but I'm not sure what will actually happen when you delete the dataset. The book says VSAM data will be altered by binary 0s.

Re: Empty out the Dataset

PostPosted: Wed Dec 29, 2010 1:34 am
by fornanthakumar
Hi Enrico-sorichetti,

I aim is not criticizing answers here. More-ever i got so many information from steve-myers for my other posts.

He just mention for securtiy erase program and something which is not related to here. So better we stop it here.

Without you people i will not learn stuff much easier.

My appologize if any one hurts due to my reply..