I posted before about generating unique random values. I have since that time altered my strategy for getting my code to work, though it still doesnt, and I am still looking for a solution.
I am trying to test for equality in two variables in a single dataset. If such an equality exists, for example if variables X and Y both have a value of 3 in the same observation, then I want to exit out of the current iteration and do it over again.
%macro MC(name= ,number= );
%DO n=1 %to &number;
DATA &name&n;
%samp;
%srt;
RUN;
DATA &name&n;
SET &name&n;
LAGRY=LAG(RY);
If RY=LAGRY then skip;
RUN;
skip: n=n-1;
%END;
%mend MC;
Do any of you have a suggestion as to how I can "quit" the current iteration and do it agian?
I have also tried the following:
%macro MC(name= ,number= );
%do %until (count=&n);
DATA &name&n;
%samp;
%srt;
RUN;
DATA &name&n;
SET &name&n;
LAGRY=LAG(RY);
If RY ne LAGRY then COUNT+1
RUN;
%END;
%mend MC;
Any suggestions?
I am trying to test for equality in two variables in a single dataset. If such an equality exists, for example if variables X and Y both have a value of 3 in the same observation, then I want to exit out of the current iteration and do it over again.
%macro MC(name= ,number= );
%DO n=1 %to &number;
DATA &name&n;
%samp;
%srt;
RUN;
DATA &name&n;
SET &name&n;
LAGRY=LAG(RY);
If RY=LAGRY then skip;
RUN;
skip: n=n-1;
%END;
%mend MC;
Do any of you have a suggestion as to how I can "quit" the current iteration and do it agian?
I have also tried the following:
%macro MC(name= ,number= );
%do %until (count=&n);
DATA &name&n;
%samp;
%srt;
RUN;
DATA &name&n;
SET &name&n;
LAGRY=LAG(RY);
If RY ne LAGRY then COUNT+1
RUN;
%END;
%mend MC;
Any suggestions?