BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
desireatem
Pyrite | Level 9

Please can someone help tell me why the data Ycomple1 is not being created despite the data Ycomple exist.

 

%macro multi;

data Ycomple1;  /*** This data is not created *****/;
set Ycomple;       / ** This data exist ****/;
%do i=0 %to  100;
ipw&i=ipw*WGT&i;
drop WGT&i;
%end;
run;
%mend multi;
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User

Run the following and post the log then we can tell you why.

EDIT: I don't see the macro actually called so adding that in, just in case. 


options mprint symbolgen;
%macro multi;

data Ycomple1;
set Ycomple;
%do i=0 %to 4;
ipw&i=ipw*WGT&i;
drop WGT&i;
%end;
run;
%mend multi;



%multi;

 


@desireatem wrote:

Please can someone help tell me why the data Ycomple1 is not being created despite the data Ycomple exist.

 

%macro multi;

data Ycomple1;  /*** This data is not created *****/;
set Ycomple;       / ** This data exist ****/;
%do i=0 %to  100;
ipw&i=ipw*WGT&i;
drop WGT&i;
%end;
run;
%mend multi;

 

View solution in original post

5 REPLIES 5
ghosh
Barite | Level 11

put another semicolon after %end

 

%end; ;
desireatem
Pyrite | Level 9

That does not solve it.

ghosh
Barite | Level 11

please show the error log

Reeza
Super User

Run the following and post the log then we can tell you why.

EDIT: I don't see the macro actually called so adding that in, just in case. 


options mprint symbolgen;
%macro multi;

data Ycomple1;
set Ycomple;
%do i=0 %to 4;
ipw&i=ipw*WGT&i;
drop WGT&i;
%end;
run;
%mend multi;



%multi;

 


@desireatem wrote:

Please can someone help tell me why the data Ycomple1 is not being created despite the data Ycomple exist.

 

%macro multi;

data Ycomple1;  /*** This data is not created *****/;
set Ycomple;       / ** This data exist ****/;
%do i=0 %to  100;
ipw&i=ipw*WGT&i;
drop WGT&i;
%end;
run;
%mend multi;

 

desireatem
Pyrite | Level 9

Thank you, you are right, it wasnt being called.

sas-innovate-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 1693 views
  • 4 likes
  • 3 in conversation