On OS390 using JCL and SAS , I am reading an I/P file which contains more than million records. I read and format by accessing various db2 tables where I use sort and merge. My program runs fine upto 400,000 records. But when an I/P file contains more than a million, the job fails in a sort statement and gives following error. "Sort failed during output after writing 810664 observations successfully write to WORK.INLOAD7.DATA failed. File is full and may be damaged."
In my JCL, i specified my work file as
//WORK DD UNIT=DISK,SPACE=(CYL,(1500,2500)) .
I also used OPTIONS=SORTBLKMODE in my JCL. But I am still having the same issue.
Considering that you have not shared other related SAS code from your program, possibly there are some SAS WORK. members that can be deleted at the point you are getting the error? The problem, as explained in the SAS diagnostic, is that you have exceeded your //WORK allocation, either because there is no more space available to your job or your job does not have a means of extending to additional DASD volumes.
The DFSORT-specific SAS CONFIG option SORTBLKMODE yields a performance benefit but does not provide a space compression features.
The SAS COMPRESS=YES will help, possibly, but I would encourage you to review the SAS DATA or PROC step that is creating WORK.INLOAD7, just prior to the error, and use SAS PROC CONTENTS DATA=WORK._ALL_; to review the members of your WORK allocation to determine if you can delete either files or variables from any "currently created" WORK files.
After checking your own SAS processing logic, you may also have an opportunity to let SAS extend to additional DASD volume(s) by including in the UNIT= parameter additional request -- specifically:
//WORK DD UNIT=(DISK,n),SPACE=(CYL,(pppp,ssss))
where "n" is some number greater than 1 and "pppp" is primary and "ssss" is secondary space allocation in cylinders.
But, as mentioned, before you go throwing DISK space at your program, look to improve and optimize your SAS job processing first.
Using the COMPRESS option requires additional CPU time, and the amount of space saved with compression is data-dependent. The SEC6 ABEND code is related to this condition - check the SAS support website for details, if interested.