12-09-2011 10:19 AM
I need to read an external file with the following specific.
The first filed is a date in the format MM/DD/YYYY HH:MMS, then we have a character field of variable lenght and then we have a number. The number should have decimal digits and not.
The separator is ";"
I've tried with mmddyyyy, anydtdtm and some other stuffs like this but nothing is working. Also trying to read the number Im getting problem.
I'm sorry but I'm new with SAS.
Any suggestion will be very appreciate.
12-09-2011 10:34 AM
This code worked for me.
infile 'c:\temp\mydata.txt' dlm=';';
INFORMAT dt1 anydtdtm. txt1 $8. num1 best12.;
FORMAT Dt1 datetime21.;
INPUT dt1 txt1 num1;
The data are also easy to bring in using Enterprise Guide.
12-09-2011 10:55 AM
many thanks for your reply.
It's work but I forget to specify another option.
If the XXX or YYY are missing, I mean if I have a row like this,
it should be continue to work saving a missing value on the second variable of the dataset for that observation.
Right now it shift the values to left.
I've tried with the attribute missover but it does not work.
Do you have any idea?
12-09-2011 11:01 AM
See "reading delimited data" in
The DSD option addresses consecutive delimiters.
Need further help from the community? Please ask a new question.