I have a variable that shows a date . I want to create a variable that shows the year i.e. to extract digits 6-9.
The problem is that it is a numeric variable (double precision , %tc) although it looks like a string so one cannot use the substr command.
I tried generating a string from it so as to use substr but that didn't work either.
There must be some easy of doing this?
1. | 06nov2021 00:00:00 |
2. | 03oct2021 00:00:00 |
3. | 10nov2021 00:00:00 |
4. | 14oct2021 00:00:00 |
5. | 09oct2021 00:00:00
The problem is that it is a numeric variable (double precision , %tc) although it looks like a string so one cannot use the substr command.
I tried generating a string from it so as to use substr but that didn't work either.
There must be some easy of doing this?
1. | 06nov2021 00:00:00 |
2. | 03oct2021 00:00:00 |
3. | 10nov2021 00:00:00 |
4. | 14oct2021 00:00:00 |
5. | 09oct2021 00:00:00
Comment