The reason you are getting the error is because you haven't told SAS how many elements the array will have. Normally you don't have to tell SAS that because it can count the variables you listed. But since you are making a temporary array there aren't any variables to count.
Use a HASH object instead.
NDC codes are not a good domain to use as the index into an array. Especially since they are best represented as TEXT variables so that you an put the hyphens in the right places.