Nothing is too much. I love these questions Gonna go out for lunch to give farewell to my classmate who just graduated. Will respond after lunch(Chicago time).Hang in there. Cheers
The set statement reads one record into a memory area known as program data vector that holds the observation while datastep is executed So when set have executes for the 1st time A 10 100 1 is read into memory and is held for further processing i.e using other statements that follows set statement Now let's get into the loop. The index variable n when 1, references the 1st element of the array as j(n)<=>income Inc_rain_snow=vname(j(n)); this resolves to Inc_rain_snow=vname(j(1)) and that is Inc_rain_snow=vname(income); similarly value=j(n); resolves to value=j(1); and that is value=income; the rest of the variable values remain undisturbed and the output statment writes the contents in the memory to the output dataset. The same happens for 3 iterations as we loop through the 3 elements in the array. So the output statement executes thrice within the loop writing the value of area A thrice.
Once SAS has executed all the statements for the 1st records, the process repeats for the next record until end of file as it goes back to the top of the datastep.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!