BookmarkSubscribeRSS Feed
Cho8
Calcite | Level 5
data utma_test2;
set test;

array search(5) acct_1-acct_5;
array find(5) test1 test2 test3 test4 test5;

do i=1 to dim(search);
if find(search(i), 'ABCD', 'i')>0 then find(i) = 'ABCD';
end;
run;




25 GOPTIONS ACCESSIBLE;
26 data utma_test2;
27 set test;
28
29 array search(5) acct_1-acct_5;
30 array find(5) test1 test2 test3 test4 test5;
NOTE: The array find has the same name as a SAS-supplied or user-defined function. Parentheses following this name are treated as
array references and not function references.
31
32 do i=1 to dim(search);
33 if find(search(i), 'ABCD', 'i')>0 then find(i) = 'ABCD';
ERROR: Too many array subscripts specified for array find.
34 end;
35 run;
Quentin
Super User

The NOTE in the log explains the problem.  Suggest changing the name of the array to Find_ or Found or whatever names makes sense and isn't already being used by SAS.  You'll have to change the name in both the array statement and when you reference the array.

The Boston Area SAS Users Group is hosting free webinars!

Register now at https://www.basug.org/events.

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 16 replies
  • 6047 views
  • 1 like
  • 4 in conversation