I am attempting a do loop which scans 16 variables and 16 format values bouncing off of sashelp.vcolumns data. In my code I am creating a quality check that will notify me if conditions are not met including the format of the 16 variables. The problem is that the macro x2 populates as 10 or 40 instead of the intended string of "$10." "$40." Why does it drop the special characters and how can I correct that? do I have to concatenate? code example: data var_check; set sashelp.vcolumn (rename=(format=fmtt)); where MEMNAME = "&FILE" AND LIBNAME ="&LIB"; keep MEMNAME LIBNAME NAME TYPE FMTT LENGTH; run; %Let var = account_id product_id; %let fmt = $10. $40. ; %let num = 2; Macro cat ; %do i=1 to # %let x1 = %scan(&var, &i); %let x2 = %scan(&fmt, &i); title "Wrong format for &x1" select distinct name, fmtt from var_check where name = &x1 and fmtt <> "&x2"; quit; %end; %end; %mend; %cat;
... View more