Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- data crf4;
- retain module;
- set crf3;
- *add module;
- if index(col1, "ADAGT:") > 0 then module = col1;
- findmax=length(compress(col1,']','k'));
- run;
- *find max number of raw var;
- proc sql noprint;
- select max(findmax)
- into: maxn trimmed
- from crf4;
- quit;
- data varname(drop=col1 flag findmax i pos1 pos2 diff pageno check);
- set crf4;
- *only bring in raw var names;
- where flag= "Y" ;
- array varname {*} $40 variable1-variable&maxn. ;
- do i = 1 to &maxn. by 1;
- check = index(col1, "]");
- if check ne 0 then do;
- *get varname outside of [];
- pos1 = find(col1, '[') ;
- pos2 = find(col1, ']');
- diff = pos2-(pos1+1);
- varname{i}= upcase(substr(col1, pos1+1, diff));
- col1= substr(col1, pos2+1);
- end;
- end;
- *get pageno as numeric;
- page = input(scan(pageno, 2), best.);
- run;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement