Just the mention of ARRAYs and DO loops is enough to make a new SAS® programmer want ..... EXAMPLE OF ITERATIVE DO LOOP WITH INDEXED ARRAY.
support.sas.com