Page 1 of 1

'Breaking' a VSAM KSDS

PostPosted: Sun Jan 18, 2015 10:41 pm
by Aki88
Hello,

I know it is not advisable, but out of curiosity - is it possible to "completely empty" a KSDS, 'completely empty' here means removing the control information of the KSDS as well.

Scenario: there is a KSDS which has some records in it, now same has been emptied by using an IDCAMS REPRO with a 'DD DUMMY' INDD statement. Is there a way to end up deleting the control info as well, thereby rendering the KSDS unusable even in OPEN/EDIT/WRITE mode. Corrupting a KSDS is different, what I am referring to is removing the bits themselves which are set/reset depending on the type of access and other similar control info.

And before I get bashed for asking, I know that this is a bad question, though trust me there is good story behind this one.

Thanks.

Re: 'Breaking' a VSAM KSDS

PostPosted: Mon Jan 19, 2015 2:38 am
by enrico-sorichetti
though trust me there is good story behind this one.

tell us the story so that we can give You a good answer

Re: 'Breaking' a VSAM KSDS

PostPosted: Mon Jan 19, 2015 1:00 pm
by Aki88
Hello Enrico,

A fair while back, while emptying out a KSDS using IDCAMS I'd managed to render it unusable. I understand- playing with the KSDS might've corrupted it, would be the plausible conclusion here.
Though I was able to recreate the aformentioned KSDS corruption by using the same JCL, which had a delete/define of KSDS step, and a subsequent IDCAMS/or another utility program for emptying it (it is this step which I am unable to recall, though I am positive on the point that it was an IBM utility program). This same JCL minus the del/def step, when run with a KSDS having data would again yield the same results i.e. not-working-empty KSDS.

It might come as mixing of terminologies here, though, I'd verified LISTCAT of this DS as well, it didn't show anything except for a couple of informational messages (I am unable to recall the same).
File management tools as File-Manager, File-Aid etc, all showed the message- Dataset is Empty, and not the usual - dataset is unusable - message, which is thrown if the dataset is corrupted. The thing to note here is, FM or FA both allow the user to open the dataset in EDIT mode/View mode even if the DS is empty, in this case same wasn't working (message thrown was DS is empty). COBOL file open wasn't working, the usual file-stat '97' was being set, IDCAMS VERIFY kept returning informational message (I am unable to recall them).
Any attempt to write data to this KSDS using IDCAMS REPRO failed with a CC 8.
On searching the web for the reason, what I'd come to understand back then was that I'd somehow managed to remove the file control information; though it didn't make any sense to me as to how this is even possible.

A few days back during a training session I tried recreating the steps, but couldn't work it out as I was unable to recall the program I'd used back then or the informational messages; hence the query that is it even possible to delete the control information of a KSDS using a utility program. This query is only to understand the KSDS organization better; like I'd said earlier, it is indeed a bad question, though out of curiosity; any guidance is much appreciated.

Thanks.

Re: 'Breaking' a VSAM KSDS

PostPosted: Mon Jan 19, 2015 2:48 pm
by enrico-sorichetti
not enough info to continue!

Re: 'Breaking' a VSAM KSDS

PostPosted: Mon Jan 19, 2015 3:07 pm
by Aki88
Hello Enrico,

I am sorry, but I really don't have more details, whatever I've written is basis what I could recollect, else I'd have built the JCL and shared the error/info messages post its execution.

Though, just a summary question:

Aki88 wrote:is it even possible to delete the control information of a KSDS


Thanks.

Re: 'Breaking' a VSAM KSDS

PostPosted: Thu Jan 22, 2015 3:36 am
by Mickeydusaor
if this dataset has an alternate index you will end up having this problem if you did not deal the alternate first.

Re: 'Breaking' a VSAM KSDS

PostPosted: Thu Jan 22, 2015 1:19 pm
by Aki88
Hello Mickeydusaor,

Mickeydusaor wrote:if this dataset has an alternate index you will end up having this problem if you did not deal the alternate first.


The DS is a plain old KSDS, requirement is to break it thereby resulting in similar situation as stated in previous posts.

Thanks.