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.
Available on demand!
Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.
What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.
Find more tutorials on the SAS Users YouTube channel.
Select SAS Training centers are offering in-person courses. View upcoming courses for: