11-23-2017 10:33 AM
Quick question for you guys: I basically want to create a macro variable called syserr1 that if greater than 0 will give me an error message in an other code.
Now, the code below creates my macro variable no problem, I was just wondering if it was possible to create ONLY one macro variable in my procedure instead of 3? (AKA no need to create &nobs and &nuniqid
proc sql; select count(distinct ID) as Nuniq, count(*) as Nobs, calculated Nobs - calculated Nuniq as diff into :nobs, :nuniqid, :syserr1 from Have ; quit;
11-23-2017 10:38 AM
I really don't understand your question. If you only want one macro variable, then only select one data item:
proc sql; select count(distinct ID) into :nobs from Have; quit;
11-23-2017 10:44 AM
Need further help from the community? Please ask a new question.