So far we were able to generate 4 files for our 2017 data using the code I described and no issues with my machine. Yes, it's a mix of char , date and numeric but no pattern.
You are splitting your dataset be columns rather than by rows, possibly because your number of columns is know, but the number of rows is not always known. If so, you can run this:
data step FILE1 FILE2 FILE3 FILE4;
set MASTERFILE nobs=nrecs;
if _n_<= nrecs/4 then output file1; else
if _n_ <=nrecs/2 then output file2; else
if _n_ <= 3*nrecs/4 then output file3;
else output file4;
run;
Regardless of the dataset size, this outputs the first 25% to file1, the 2nd 25% to file2, etc.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.