In FILE SORT, space will be allocated for internal sorting of the sort keys. The default size of this space is 65500 bytes and it can be altered by the specification WORKSPACE=<size_in_bytes>. If more space is required for the sort keys, FILE SORT performs internal sorts for subsets of data, saves the sorted keys in intermediate files and merges these files in one or several passes. Finally, the original data set will be moved to the sorted file according to the the last merged file of the sort keys. Thus, in principle there are no limits for the size of the data to be sorted. The number of intermediate files merged in one pass is 4 by default. This number can be altered by the specification FILEMAX=<#_of_files>. Maximum is 12. S = More information on FILE SORT