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

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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
  • 848 views
  • 3 likes
  • 3 in conversation