I have a dataset that I need to work with, every month a new set of columns are added with various names but have the month and year in the middle of the column name. I.e.
Column_1_May_24_hello
Column_2_May_24_bye
Column_1_June_24_hello
Column_2_June_24_bye
and so on.
Each month I want to reference the new set of columns. I currently have to do a control/replace to replace all the months and years with the new ones in the code.
Is there anyway to adapt the code so I wouldn’t need to do find/replace? I’m used to SAS where I’d have macro variables used as column names or perhaps run do loops to create a new dataset with each month_year as a row and Hello and Bye (Examples) as the columns.
Any help with this would be greatly appreciated as not sure where to start.