Search code examples
sas

Unable to change data format


I need to convert dates in the following forma:

30-giu-18        
30-nov-20      
......         

into:

30JUN2018        
30NOV2020      
.......         

I tried:

     data Test; 
       set input;
       mydates = input(myolddates, ddmmyy10.;)
       format mydates ddmmyy10.;
     run;         

It doesn't work. The variable myolddates is character $9. Can anyone help me please?


Solution

  • Try this

    data have;
    input myolddates $9.;
    datalines;
    30-giu-18 
    30-nov-20 
    ;
    
    options dflang = Italian ;
    
    data want;
       set have;
       date = input(myolddates, EURDFDE9.);
       format date ddmmyy10.;
    run;