Hello, First time posting! I have some sql code where I Select multiple columns with the same name except the final digit in them. I'd like to clean up the code and cannot figure out the loop to write for this. The &IN_SCOPE_CARS is a list of cars that I want to only include in the table. I also searched and could not seem to find a solution for when all the columns names are what is being looped through and the table was staying the same. PROC SQL; CREATE TABLE WORK.TABLE AS SELECT CAR1 ,CAR2 ,CAR3 ..... ,CAR10 FROM WORK.DATASET WHERE CAR1 IN (&IN_SCOPE_CARS.) OR CAR2 IN (&IN_SCOPE_CARS.) OR CAR3 IN (&IN_SCOPE_CARS.) OR ..... CAR10 IN (&IN_SCOPE_CARS.)
... View more