Page 1 of 1

Can we use Sort utility on VSAM file?

Posted: Sat Aug 06, 2022 6:00 pm
by Radhika Apte
Can we use Sort utility on VSAM file?

Problem is Vsam file using sort utility and include state creates 5 vsam file but bcs of the one condition one file is empty. That file collects some garbage, Hence the subsequent job fails.

But the same created empty with idcams doesnt fail in subsequent job.

Re: Can we use Sort utility on VSAM file?

Posted: Mon Aug 08, 2022 8:31 pm
by Robert Sample
That file collects some garbage, Hence the subsequent job fails.
Highly unlikely. More likely what is happening is that SORT does not open the output file until there are records to write to it (this is, by the way, a guess -- I've never tried something like this to verify the behavior). When a data set is allocated but not opened for output, there is nothing in the data set and typically whatever data was located at that spot on the disk drive is accessible when a program opens the data set for input. And that data is unlikely to have the same DCB as what you're trying to put out there.

Re: Can we use Sort utility on VSAM file?

Posted: Fri Sep 09, 2022 8:49 pm
by Radhika Apte
That was the problem, one of the VSMAs were getting reallocated as empty.