BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
hhchenfx
Rhodochrosite | Level 12

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
1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User
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;

View solution in original post

3 REPLIES 3
PaigeMiller
Diamond | Level 26

PROC IMPORT reads the data perfectly

 

proc import datafile="f:\my documents\example.csv" dbms=csv out=want;
run;

 

--
Paige Miller
Kurt_Bremser
Super User
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;
hhchenfx
Rhodochrosite | Level 12

Thank you all for helping.

HHC

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 983 views
  • 1 like
  • 3 in conversation