For most of the cases to optimize the system, we would be in need of the size of the data set, to set some SAS System options like : SORTSIZE, MEMSIZE, REALMEMSIZE etc.
To Calculate size of any SAS dataset:-
For example we want to calculate the size of a data set named as "Calculate" which one is in library named as "Base". Just create the data set that contains one observation and all the number of variables we are in need.
Data base.Calculate;
input name $18. Age 2. Salary 6. ;
Cards;
Uma Shanker Saini 30 300000
;
run;
Proc print;
run;
Now run the CONTENTS procedure with the data set "Calculate".
Proc contents data=Base.Calculate;
Run;


The size of the Calculate data set would depend on the data set page size and the total number of observation in data set.
Formula to calculate :-
Number of data pages = 1 + (floor( observations / Max observation per page))
Size = 256 + ( Data set page size * number of data pages)
* floor is a function which is to round the value
Now as per our example :
Number of data pages = 1 + (floor(1/101))
Data set size = 256 + 4096*1 = 4352
Thus the Calculate data set uses 4,352 bytes of storage space.