BookmarkSubscribeRSS Feed
maroulator
Obsidian | Level 7

 

I have the split macro below that I have been trying to run unsuccesfuly because I get the following error; NOTE: Line generated by the macro function "I." I have tried some solutions I found online, but I really think that I'm missing smth very obvious; could someone please take a look and let me know what they think? The in.cur_mod2 dataset has 59,325 observations and I am trying to split it into smaller datasets.

 

Thanks in advance.

 

 

options mlogic mprint symbolgen;

%macro split(num);

 

data _null_;

if 0 then set in.cur_mod2 nobs=count;

call symput('numobs',put(count,8.));

run;

%let n=%sysevalf(&numobs/&num,ceil);

data %do J=1 %to # orig_&J %end;;

set in.cur_mod2;

%do I=1 %to #

if %eval(&n*(&i-1))<_n_<=%eval(&n*&I)

then output in.cur_mod2_&I;

%end;

run;

%mend;

%split(10);

 

3 REPLIES 3
Reeza
Super User

Don't. 60,000 records is trivial for SAS and whatever reason you have for splitting the file can be accomplished in another manner. 

 

Reeza
Super User

Also, in general, post more of your log, from start to error at least. 

Astounding
PROC Star

The data set names in your DATA statement do not match the names in your OUTPUT statement.

 

That may be a separate issue since it does not seem related to the error message you are getting.

 

That message might imply that one variation of your code included something like %i(........)

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1040 views
  • 3 likes
  • 3 in conversation