|
No, the delimiter and things on the second line are modifiers to the infile statment, so you should NOT have a semicolon afer the filename.
infile 'P:\Work_Activities\temp.txt';
should be:
infile 'P:\Work_Activities\temp.txt'
delimiter..... ;
-Mary
----- Original Message -----
From: Irin later
To: SAS-L@LISTSERV.UGA.EDU
Sent: Friday, May 16, 2008 3:04 PM
Subject: Re: How to import tilde delimited text file directly to SAS 9 through sas code?
I put a semicolon after infile statement but error log still complains on syntax:
39 data WORK.DATA_MASTER ;
40
41 infile 'P:\Work_Activities\temp.txt';
42
43 delimiter='~' MISSOVER DSD lrecl=32767 firstobs=2 ;
--------
388
76
ERROR 388-185: Expecting an arithmetic operator.
ERROR 76-322: Syntax error, statement will be ignored.
I tried eq instead = but it doesn't work.....
--- On Fri, 5/16/08, Mary <mlhoward@avalon.net> wrote:
From: Mary <mlhoward@avalon.net>
Subject: Re: How to import tilde delimited text file directly to SAS 9 through sas code?
To: irinfigvam@yahoo.com, SAS-L@LISTSERV.UGA.EDU
Date: Friday, May 16, 2008, 3:05 PM
One way you could go is to write code to import them specifying the delimiter:
data WORK.DATA_MASTER ;
infile 'C:\Work_Activities\temp.txt'
delimiter='~' MISSOVER DSD lrecl=32767 firstobs=2 ;
informat varname $40. ;
format varname $40.;
input
varname $;
obsnum + 1;
run;
You might be able to persuade SAS to write the code for you by getting into the Display Manager, then choosing File-Import Data, then selecting "Delimited File"; you can save the source code after it is done and then fool with it if it wasn't able to import correctly.
-Mary
----- Original Message -----
From: Irin later
To: SAS-L@LISTSERV.UGA.EDU
Sent: Friday, May 16, 2008 12:54 PM
Subject: How to import tilde delimited text file directly to SAS 9 through sas code?
My text tilde delimited source files are too huge to import them to Excel 2002 in order to import then to SAS 9. On the other hand they have data to be fixed and Access rejects part of them.
I am trying to find a way for importing these text tilde delimited files directly into SAS 9.
Could you please help me with a code?
Thank you in advance!
Irin
|