Page 1 of 1

Can i read output file created after SORTing in the same pgm

PostPosted: Sat Feb 06, 2021 1:17 am
by savitha_y
Can i read output file created after SORTing in the same program.

SORT WORK-FILE ON ASCENDING KEY SORT-KEY USING INPUT-FILE GIVING OUTPUT-FILE.
Is there any way, I can read sorted out OUTPUT-FILE in the same program after creating it.

Thank you.

Re: Can i read output file created after SORTing in the same

PostPosted: Tue Feb 09, 2021 11:08 am
by chaat
Have you tried to open the file as input after the sort ?

Re: Can i read output file created after SORTing in the same

PostPosted: Tue Feb 09, 2021 2:35 pm
by willy jensen
With DFSORT your SORTOUT can be the dataset as SORTIN, so yes.

Re: Can i read output file created after SORTing in the same

PostPosted: Tue Feb 09, 2021 7:03 pm
by sergeyken
savitha_y wrote:Can i read output file created after SORTing in the same program.

SORT WORK-FILE ON ASCENDING KEY SORT-KEY USING INPUT-FILE GIVING OUTPUT-FILE.
Is there any way, I can read sorted out OUTPUT-FILE in the same program after creating it.

Thank you.

There is nothing special for SORT, or any other program.

Any output DATASET(!) can be opened for input in the same, or any other program, in the same, or any other job step, in the same, or any other job, provided the output dataset has been properly CLOSED after its creation.

That’s it. These are basics of zOS/MVS/...

Re: Can i read output file created after SORTing in the same

PostPosted: Tue Feb 09, 2021 7:11 pm
by savitha_y
Thank you all for your response. I tried it and it is working fine.