Currently, I have the variable, calldate, which is in the format 09jul2019, 10jul2019, etc.

Is there any way I could change it into the format 20190709, 20190710?

I tried the following code, but it said type mismatch in both the lines:

Code:
 
 gen date2 = date(calldate, "DMY") format date2 %td
Thanks a lot!