Empty out the Dataset



IBM's Command List programming language & Restructured Extended Executor

Re: Empty out the Dataset

Postby Pedro » Mon Dec 20, 2010 8:30 pm

... 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.
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 enrico-sorichetti » Mon Dec 20, 2010 8:46 pm

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
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Empty out the Dataset

Postby steve-myers » Tue Dec 21, 2010 1:34 am

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.
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 enrico-sorichetti » Tue Dec 21, 2010 1:40 am

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 )
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Empty out the Dataset

Postby NicC » Tue Dec 21, 2010 10:33 am

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'
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 fornanthakumar » Sat Dec 25, 2010 6:14 am

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 ...
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 dick scherrer » Sat Dec 25, 2010 11:11 am

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.
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 enrico-sorichetti » Sat Dec 25, 2010 2:54 pm

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:
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Empty out the Dataset

Postby steve-myers » Sun Dec 26, 2010 1:10 am

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.
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 fornanthakumar » Wed Dec 29, 2010 1:34 am

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..
Regards,
Nanthu.Y.
fornanthakumar
 
Posts: 69
Joined: Fri Oct 22, 2010 1:58 pm
Has thanked: 0 time
Been thanked: 0 time

PreviousNext

Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post