Hi,
I have a variable "date" in the following form: MMJJJJ or MJJJJ (so I sometimes have 5, sometimes 6 digits).
Now I want to generate a variable in the following form: JJJJ. So I want to drop the first digit if the date has the form: MJJJJ; or I want to drop the first two digits if it is denoted MMJJJJ:
Alternatively, I want to keep the last four digits in each observation.
How do I implement that?
Looking forward to your responses ;-)
I have a variable "date" in the following form: MMJJJJ or MJJJJ (so I sometimes have 5, sometimes 6 digits).
Now I want to generate a variable in the following form: JJJJ. So I want to drop the first digit if the date has the form: MJJJJ; or I want to drop the first two digits if it is denoted MMJJJJ:
Alternatively, I want to keep the last four digits in each observation.
How do I implement that?
Looking forward to your responses ;-)
Comment