Date: Wed, 21 Jun 2006 14:35:31 GMT
Reply-To: Eric Eyre <eeyre@CONCENTRIC.NET>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Eric Eyre <eeyre@CONCENTRIC.NET>
Organization: Road Runner High Speed Online http://www.rr.com
Subject: Re: infile data with semicolon delimiter
and simpifying even further...
-you don't need the & modifier, only the colon
-if you ditch the redundant semicolons at the end of each line, you don't
need to check for type=missing
data a;
infile cards4 DLM=";";
input type: $64. @@;
cards4;
ford taurus ; mustang GTO; whatever v whatever; data raps around like this
some more data; short data; very long data line here
;;;;
Erico
"Peetie Wheatstraw" <peetie.wheatstraw@GMAIL.COM> wrote in message
news:3e437d3f0606210619o1103c608v99865bdd9a9b53df@mail.gmail.com...
> On 6/20/06, mom <momnothere@gmail.com> wrote:
>> how might I read in a file that looks like this (sas pseudocode included)
>>
>> data a; informat type $; infile cards DLM=";";
>> cards;
>> ford taurus ; mustang GTO; whatever v whatever; data wraps around like
>> this; some more data; short data; very long data line here;
>
> The 2 lines after the cards stmt qualify as spaghetti data. In particular,
> the 4th value spans 2 input lines. SAS doesn't like that.
>
> If you can organize your data such that the values don't span
> multiple lines, it could maybe look as simple as:
>
> data a;
> infile cards4 DLM=";";
> input type :&$64. @@;
> if missing(type) then delete;
> cards4;
> ford taurus ; mustang GTO; whatever v whatever; data wraps around like
> this;
> some more data; short data; very long data line here;
> ;;;;
> run;
>
> So maybe consider the data first, and the program second?
>
> Peetie
|