I have a data set where the Columns are labeled Month181, month182 , month183, .............., month1810 , month1811, month1812, month191, month192
I want to be able to select the last 12 months for example i want the cols Month1810 to Month199
Month1810 Month1811 month1812 month191 month192 month193
1 0 0 0 1 0
0 1 0 0 1 1
1 1 0 1 1 0
0 1 0 1 1 1
keep month1810--month199 /* add other variables you want to keep as well */;
in a SAS data step will get you there.
I point out that this is a very poor arrangement of the data for most purposes, and you'd be much better off (for most purposes) with a long data set rather than a wide data set.
Hello,
Why don't you convert your file into Excel and then delete the observations you don't need.
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!
Check out this tutorial series to learn how to build your own steps in SAS Studio.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.