Skip to content

Instantly share code, notes, and snippets.

@appikonda
Created September 30, 2019 14:04
Show Gist options
  • Save appikonda/5da8639ac9e94958a8633ce98b9bc10b to your computer and use it in GitHub Desktop.
Save appikonda/5da8639ac9e94958a8633ce98b9bc10b to your computer and use it in GitHub Desktop.
macros
%macro test(start, finish, inc, limit);
%let y=0;
%end;
%do i= %sysevalf(&start) %to %sysevalf(&finish);/* %by &inc;*/
%if (&y < &limit) %then %do;
%let y = %SYSEVALF(&i**2);
%put the value of i is &i , &y;
%let start =%SYSEVALF(&i+ &inc);
%put the value of start is &start;
%end;
%ELSE %DO;
%PUT in else;
%end;
%end;
%mend test;
%test(1, 5, 1, 20)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment