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-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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