My question is WHERE do you need to have distinct sets of three consecutive numbers??? What good will the numbers in the log do??? Is this part of a bigger program or a different problem???
At any rate, there's nothing wrong with changing the value of &RUNMP inside the %DO loop. So if you changed the ending value to 15
%do RunMP = 1 %to 15;
...Since, there's nothing wrong with "resetting" the value of &RUNMP -- and, since the %DO loop will automatically increment by 1...the simplest thing to do after your %PUT is to reset the value of &RUNMP to be equal to the value of &P3:
%put &p1 &p2 &p3;
%let RunMP = &p3;
You should also keep in mind that if you have a number of elements to display which is not a multiple of 3, you could see unresolved macro-variables displayed (text '&p1', '&p2' or '&p3' ) in your log... So you should check that each macro-variable you want to display exists prior including its reference in the %put statement.
the %gen() macro and variants has been posted before
Objective is to generate a pattern, subject to cycling numbers, so can simply be 1 2 3 or generate 10 11 12 .
What is confusing me here is the break in groups of 3.
%put NOTE- 1 2 3;
%put note- 4 5 6;
%put note- 7 8 9 ;
demonstrates one way to place text in the log with NOTE coloring, but without the NOTE: prefix.
Was that what "edilts" wanted?
More effective is a data step, like[pre]data _null_ ;
put 'NOTE- 1 2 3';
put 'NOTE- 4 5 6';
put 'NOTE- 7 8 9' ;
run;[/pre]which produces the log[pre]113 data _null_ ;
114 put 'NOTE- 1 2 3';
115 put 'NOTE- 4 5 6';
116 put 'NOTE- 7 8 9' ;
1 2 3
4 5 6
7 8 9
NOTE: DATA statement used (Total process time):[/pre]