1
votes

I would like to import data from a csv file in a permanent data set which has this date column with data format like "dd-mmm-yyyy" like "22-FEB-1990". I want this to be imported as date format inside the data set too. I have tried many format informats but i am not getting anything in the column.

Here is the code i wrote(While I commented out certain things I have tested all the permutations and combinations with the formats and informats i could think of):

    libname asgn1 "C:\Users\*****\abc";          
    data asgn1.Car_sales_1_1;                
          infile  "C:\Users\********\Car_sales.csv" dsd dlm="," FIRSTOBS=2 ;
          input Manufacturer $ Model $ Fuel_efficiency Latest_Launch; 
          * format Latest_Launch mmddyy10.;
          * informat  Latest_Launch mmddyy10.;             
    run; 

Please help...

2

2 Answers

1
votes
0
votes

I tried the following code and I got just the result I wanted....Thanks @Chris J

    libname asgn1 "C:\Users\*****\abc";          
       data asgn1.Car_sales_1_1;                
      infile  "C:\Users\********\Car_sales.csv" dsd dlm="," FIRSTOBS=2 ;
      input Manufacturer $ Model $ Fuel_efficiency Latest_Launch; 
      informat  Latest_Launch date11.;
      format Latest_Launch ddmmyy10.;             
    run;