lundi 9 décembre 2019

If condition and a proc sql inside a macro program

I have some control to verify . I want to write a macro vriable who include a SQL proc in case the condition is verified exemple

%Macro Control1(&List);

%IF "&Control1" in (&Liste.)%Then %do;

proc sql;

create table work.&Control1 as

Select id count(id) as number

From data.&Prouduit.

group by id
having number nb > 1
;
quit;

%end;

%mend;

%let list = &control1. &control2 &Control4 ;

%Control1(&List);

if we do the same process to control3 the proc sql doesn't run because control3 doesn't belong to the list .

Since i'm beginner in sas i think i made some mistakes in the syntax (and my english also )

thank you

Aucun commentaire:

Enregistrer un commentaire