Hello everyone, I am new to SAS and I'm wondering how I could loop a procedure (if possible that is).
I have written this:
options fmtsearch= (projet.formats) ; PROC PRINT data=PROJET.CORAIL noobs;
DO Region=1 to 6;
VAR Economic_Health Risk Population;
FORMAT Region Region.;
FORMAT Risk Risk.;
FORMAT Economic_Health Economic_Health.;
But I get an error which says "Statement is not valid or it is used out of proper order". I can obtain a right result if I remove the DO statement and put a WHERE Region=1 statement but this would rewriting the procedure 5 times, which doesn't seem very practical in my opinion. What are the possible alternative?