Look at the below scenario, here i have created a data set having Month, X1, X2, X3,…X6 as variables.
Input Month$ X1 X2 X3 X4 X5 X6;
Jan 1 2 3 4 5 6
Feb 7 8 9 10 11 12
Mar 13 14 15 16 17 18
Let’s say, i want to drop variable X2, X3, X4 and X5, This can be achieved by using below statements:
Data Check (Drop= X2-X5);
Above I have used Drop=X2 - X5, it works because x1-x5 are numerically consecutive. Now assume variables are not numerically consecutive and we want to delete variables, which are together. Like I want to drop varibale Month, X1, X2 and X3.
Data Check (Drop= Month--X3);
Above I have used Drop=Month – X3, it works because Month – x3 are physically in order on the data set.