Split large SAS dataset into smaller datasets

前端 未结 6 482
长情又很酷
长情又很酷 2021-01-13 01:10

I need some assistance with splitting a large SAS dataset into smaller datasets.

Each month I\'ll have a dataset containing a few million records. This number will

6条回答
  •  礼貌的吻别
    2021-01-13 01:47

    Here is a basic approach. This requires manual adjustment of the intervals, but is easy to understand.

    * split data;
    data output1;
    set df;
    if 1 <= _N_ < 5 then output;
    run;
    
    
    data output2;
    set df;
    if 5 <= _N_ < 10 then output;
    run;
    
    
    data output3;
    set df;
    if 10 <= _N_ < 15 then output;
    run;
    
    
    data output4;
    set df;
    if 15 <= _N_ < 22 then output;
    run;
    

提交回复
热议问题