Help using Base SAS procedures

call macro function many times

Accepted Solution Solved
Reply
Contributor
Posts: 56
Accepted Solution

call macro function many times

Hi I have a call to a macro like

%GetData(1330);

How can I call this many times like

FOR n=1330 to 1730 by 5;

%GetData(1330);

END;

as I do not wish to write out loads of %GetData(1330); %GetData(1335); %GetData(1340); %GetData(1345); .... etc.....


Accepted Solutions
Solution
‎05-03-2012 08:37 PM
Super Contributor
Posts: 1,636

Re: call macro function many times

Hi,

try this:

%macro test;

  %do n=1330 %to 1730 %by 5;

  %getdata(&n);

  %end;

%mend;

%test

View solution in original post


All Replies
Solution
‎05-03-2012 08:37 PM
Super Contributor
Posts: 1,636

Re: call macro function many times

Hi,

try this:

%macro test;

  %do n=1330 %to 1730 %by 5;

  %getdata(&n);

  %end;

%mend;

%test

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 1 reply
  • 176 views
  • 1 like
  • 2 in conversation