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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 4 replies
  • 737 views
  • 0 likes
  • 3 in conversation