Date: Wed, 5 Nov 2008 13:47:59 -0500
Reply-To: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Gerhard Hellriegel <gerhard.hellriegel@T-ONLINE.DE>
Subject: Re: help with reading ASCII data into SAS
ok, in that case u was too short:
data a;
infile "c:\daten\test.dat" dlm="," truncover dsd firstobs=2;
input
site : 8.
id : 8.
pid : 8.
it : $5.
dd : ANYDTDTM20.
itd : 8.
rtd : 8.
linkid : 8.
sp : 8.
fc : 8.
dtc : ANYDTDTM20.
dtm : ANYDTDTM20.
u : $15.
;
u = compress(u,'""');
it = compress(it,'""');
format dtm dtc dd datetime20.;
run;
Gerhard
On Wed, 5 Nov 2008 10:20:47 -0800, olivesecret@GMAIL.COM wrote:
>Here is my code:
>
> data data;
> infile 'data.txt' delimiter=',' dsd firstobs=2;
> input site id pid it $ dd itd rtd linkid sp fc dtc dtm u $5. ;
>run;
>
>Here is one more obs:
>
>1,4,1004,"JS",9/27/2008 0:00:00,1,1,57,11,10,10/3/2008
>11:31:17,10/3/2008= 11:31:17,"AVRC\psuggett"
>
>Other obs are similar.
>
>Thank you very much!
>
>
>
>On Nov 5, 12:24 pm, Nord...@DSHS.WA.GOV ("Nordlund, Dan (DSHS/RDA)")
>wrote:
>> > -----Original Message-----
>> > From: SAS(r) Discussion [mailto:SA...@LISTSERV.UGA.EDU] On
>> > Behalf Of olivesec...@GMAIL.COM
>> > Sent: Wednesday, November 05, 2008 8:50 AM
>> > To: SA...@LISTSERV.UGA.EDU
>> > Subject: Re: help with reading ASCII data into SAS
>>
>> > Yes, I did it with delimiter=',' dsd firstobs=2, but was told invalid
>> > data for each variable.
>> > Any more suggestions? Thanks a lot!
>>
>> You will need to show us the actual code you are using to read the file
if you want more than just a guess as to what went wrong. Seeing the log
file with actual error message would be helpful as well.
>>
>> Dan
>>
>> Daniel J. Nordlund
>> Washington State Department of Social and Health Services
>> Planning, Performance, and Accountability
>> Research and Data Analysis Division
>> Olympia, WA 98504-5204
|