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.
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.
And if you are running this in a client-server environment, you need to have the file on the server. Use the Copy Files task for this.
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
@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 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.