Hi Everyone,
I have a csv file as below, and can you please help me to import it.
I always have hard time dealing with date and time.
Thank you so much.
HHC
price,product_code,date,time
100.0,AA,2022-07-27,07:00:00
450.0,AAXGH,2022-07-27,07:30:00
data want;
infile "path to your file" dlm="," dsd truncover firstobs=2;
input price,' product_code $ date :yymmdd10. time :time8.;
format date yymmdd10. time time8.;
run;
PROC IMPORT reads the data perfectly
proc import datafile="f:\my documents\example.csv" dbms=csv out=want;
run;
data want;
infile "path to your file" dlm="," dsd truncover firstobs=2;
input price,' product_code $ date :yymmdd10. time :time8.;
format date yymmdd10. time time8.;
run;
Thank you all for helping.
HHC
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.