Hi Everyone , I need assistance in the following code as I need to understand it and I'm not sure whether it fully correct, at the 1st place as log states ERROR in certain parts. Thanks. data marks; retain key1 - key10; array key{*} key1 - key10; array ans{*} ans1 - ans10; array s{*} s1 - s10; if _n_ = 1 then do; input @ 11 (key1 - key10) (1.); delete; end; else do; input id 1-10 (ans1 - ans10)(1.); do I = 1 to 10; if key {I} = ans{I} then S{I}=1; else S{I} = 0; end; row = sum(of s1-s10); percent = 100*row/10; drop I Key1-key10; end; format id ssn11; cards; anskey 3 4 5 6 7 8 9 5 4 2 1 2 5 7 8 9 6 4 5 1 2 1 2 3 5 4 7 8 9 6 5 7 4 1 3 8 5 2 3 6 4 1 2 5 4 7 ; proc sort; by id; proc print; id id; var row percent; proc chart; vbar percent/midpoints = 50 to 100 by 5; proc freq; tables ans1-ans10; run;
... View more