So I am working with a departed developers script. The script used YYYYMM to format field names so the resulting table contains fields that are like 202301, 202302, 202303 ....
I needed to create some additional aggregations off of this particular table but I cannot query a select on these fields due to the way it is set up.
Is there a way I can select these columns by their placing in the table?
Is your table actually as SAS data set? Those are not normally acceptable variable names for such. If the SAS option VALIDVARNAME=ANY is in effect then such names would have to be referenced in code as "202301"n, quotes around the column heading with the n to tell SAS to treat them a literal names.
BTW, this process has placed important information into the "heading" which may mean that many analysis and reporting tasks will be much harder with this data than it should.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.