data abx; infile datalines dlm=" "; input name :$20. score1 score2 score3; datalines;; a 23 23 23 b 23 12 12 c 23 45 66 a 66 88 99 c 34 66 45 ; run; proc sql; select distinct name,quote(name) into :k separeted by " ", :j separeted by "," from abx; quit; option mprint; data &k; set abx; array d[*] &k ;//here i did small change it is taking array but it did not send s out put to assigned data set please help// do i=1 to dim(d) ; if d[i]=name then output d[i]; end; run; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 70 71 72 73 data abx; 74 infile datalines dlm=" "; 75 input name :$20. score1 score2 score3; 76 datalines; NOTE: The data set WORK.ABX has 5 observations and 4 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 523.06k OS Memory 27048.00k Timestamp 08/02/2018 12:17:28 PM Step Count 30 Switch Count 2 Page Faults 0 Page Reclaims 168 Page Swaps 0 Voluntary Context Switches 9 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 264 76 ! ; 82 ; 83 run; 84 85 86 proc sql; 87 select distinct name,quote(name) 88 into :k separeted by " ", _________ 1 89 :j separeted by "," _________ 1 WARNING 1-322: Assuming the symbol SEPARATED was misspelled as separeted. 90 from abx; 91 quit; NOTE: PROCEDURE SQL used (Total process time): real time 0.01 seconds user cpu time 0.01 seconds system cpu time 0.00 seconds memory 5448.37k OS Memory 32172.00k Timestamp 08/02/2018 12:17:28 PM Step Count 31 Switch Count 0 Page Faults 0 Page Reclaims 686 Page Swaps 0 Voluntary Context Switches 0 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 8 92 93 94 option mprint; 95 data &k; 96 set abx; 97 array d[*] &k ; 98 do i=1 to dim(d) ; 99 if d[i]=name then output d[i]; _ 22 76 ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, ;, RC, _DATA_, _LAST_, _NULL_. ERROR 76-322: Syntax error, statement will be ignored. 100 end; 101 run; NOTE: Character values have been converted to numeric values at the places given by: (Line):(Column). 99:9 NOTE: The SAS System stopped processing this step because of errors. WARNING: The data set WORK.A may be incomplete. When this step was stopped there were 0 observations and 8 variables. WARNING: The data set WORK.B may be incomplete. When this step was stopped there were 0 observations and 8 variables. WARNING: The data set WORK.C may be incomplete. When this step was stopped there were 0 observations and 8 variables. NOTE: DATA statement used (Total process time): real time 0.00 seconds user cpu time 0.00 seconds system cpu time 0.00 seconds memory 1311.81k OS Memory 29364.00k Timestamp 08/02/2018 12:17:28 PM Step Count 32 Switch Count 6 Page Faults 0 Page Reclaims 258 Page Swaps 0 Voluntary Context Switches 27 Involuntary Context Switches 0 Block Input Operations 0 Block Output Operations 792 102 103 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK; 115
... View more