BookmarkSubscribeRSS Feed
Geo-
Quartz | Level 8

The date column values in csv file look like:

 

log_datecst_id
20180502101
20180818102

 

after I used EG to import this file,the column values in SAS all shows "."

how should I set a right format before import or change the column into the right date type after import that can show its value?

 

thanks for your time.

4 REPLIES 4
Kurt_Bremser
Super User
data want;
infile ".......csv" dlm=",";
informat
  log_date yymmdd8.
  cst_id $3.
;
input
  log_date
  cst_id
;
format
  log_date yymmddd10.
;
run;

Just use proper informats. The import wizard might have mis-guessed.

BrunoMueller
SAS Super FREQ

how does the column definition in the import data wizard look like?

 

It should look similar like this, usually EG picks the column as a date


image.png

 

Kurt_Bremser
Super User

@Geo- wrote:

The date column values in csv file look like:

 

log_date cst_id
20180502 101
20180818 102

 

after I used EG to import this file,the column values in SAS all shows "."

how should I set a right format before import or change the column into the right date type after import that can show its value?

 

thanks for your time.


Actually, your csv file (hopefully) does NOT look like this. A csv file looks like this:

log_date,cst_id
20180502,101
20180818,102

 

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 958 views
  • 0 likes
  • 3 in conversation