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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.