In releases of SAS prior to SAS 9, the maximum number of variables in a single SAS data set under all operating systems is 32,767, with the exception of Tru64 UNIX. The limitations for Tru64 UNIX are the same for all releases of SAS (see the limitations under SAS 9 below).
Other than the following limitations that apply to Windows operating systems, a SAS data set can be as large as the operating system will allow:
See SAS Note 36112, "Managing large SAS® data sets that exceed the maximum number of observations," for the details.
Note: you need to have enough free disk space to accommodate the size of the data set, regardless of the type of drive.
Beginning in SAS 9, the maximum number of variables allowed is no longer 32,767. For either Windows or UNIX platforms the maximum number of variables is limited by the first encountered limitation:
You can define a data set with an observation length of up to 2 GB on a 32-bit platform and approximately 2**46 on a 64-bit platform.
Assuming a single-byte character set, and that you use the maximum 352 bytes possible for name, label, and so on for each variable, you can have a maximum of about 4,050,000 variables. If the names, labels, and format names are shorter, you can have more than 200,000,000. There is a maximum of 1 GB to store all the variable names and other metadata (data set label, compression name, and so on).
Assuming that the above limits are not exceeded, the maximum possible number of variables on either Windows or UNIX is 412,977,617 on 32-bit hosts and 2 GB on 64-bit hosts. For the z/OS platform, the maximum number of variables is primarily limited by the maximum size of a single observation (16 MB or 1,677,7216 bytes).
For z/OS the maximum number of observations is 2**31-1 = 2147483647 (2 G).
The maximum size of a SAS data set in a Direct Access Bound Library is limited by the maximum size of the library, which is about 2986 GB on 3390 volumes.
The maximum size of a SAS data set in a USS Library is limited by the maximum number of pages, which is 2**31-1 = 2147483647 = about 2 GB. Assuming a fairly typical page size of 32 KB, the maximum size of the data set would then be about 2**46 by bytes = 64 TB. However, larger data sets could be created by specifying a BUFSIZE value larger than 32 KB.
Data sets created with SAS 9 on any operating system that contain more than 32,767 variables are not accessible by prior versions.