Hi everyone, I'm learning usage of arrays and with your comments i would like to take my learning to the next level. I have written a code below to check datatype of variables present in the array. but it is throwing below mentioned errors.
ERROR: There were 1 unclosed %DO statements. The macro DESCRIPTIVE will not be compiled. ERROR: A dummy macro will be compiled.
can anyone suggest how to solve the error and suggest if there is a way to loop over columns. i have tried %do_over but it also started throwing errors. Please guide how to move forward with the issue.
data dummy; input subjid AGE SEX BMI SODIUM INFECTION; cards; 01001 56 F 22.3 34.5 Y
01001 60 M 29.3 41.5 N
01001 35 F 26.3 22.5 Y;
01001 23 M 19.3 34.5 Y;
01001 34 F 18.3 41.5 Y;
; run;
%macro descriptive(dataset,first,last,newcol ); data _null_; set &dataset.; array variables{*} &first. -- &last.; array types{*} &newcol.; %do i=1 %to 7 ; %if %datatyp(variables) eq CHARACTER %then %do; %put variables=; %end; run; %mend descriptive;
%descriptive(dataset=dummy, first=AGE ,last=Inefection,newcol=type);
... View more