home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!usc!sdd.hp.com!swrinde!zaphod.mps.ohio-state.edu!uwm.edu!lll-winken!miguel.llnl.gov!macq
- From: macq@miguel.llnl.gov (Don MacQueen)
- Newsgroups: bit.listserv.sas-l
- Subject: Re: Infile question
- Message-ID: <135806@lll-winken.LLNL.GOV>
- Date: 9 Sep 92 16:05:05 GMT
- References: <9209032128.AA15136@ti.com>
- Sender: usenet@lll-winken.LLNL.GOV
- Organization: Lawrence Livermore National Laboratory
- Lines: 35
- Nntp-Posting-Host: miguel.llnl.gov
-
- Original question:
- ================================
- > I have a question about the use of infile to read data into SAS.
- > I have some output from an Ingress-database. This database uses a <tab> as
- > delimiter. Is it possible to get SAS to understand this too?
- > Until now I have specified a certain length for each variable in the output,
- > and the used the following code to read it:
- >
- > infile 'whatever';
- > input var1 $ 1-6 var2 $ 7-19 , ect.
- >
- > I have tried to use characters as delimiter, but I must have done something
- > wrong, because it didn't work.
- ================================
- A couple of people have suggested the EPANDTABS option.
-
- This may work, but it will depend a lot on what is in the Ingres
- file. If the data in the fields are padded with spaces before the
- tab characters, then o.k. But if they are not, then the use of
- the EXPANDTABS option will almost certainly result in the fields not
- lining up, if some of the data in any field is less than 8 characters
- long, and other data in the same field is more than 8 chars long.
-
- I say "almost certainly" because I've never used the EXPANDTABS option.
- But I have looked at tab delimited files in a text editor that expands
- tabs, and what I have described above is exactly what happens. If you
- want the fields to line up after expanding the tabs, you have to set
- the tab spacing greater than the longest data item in the entire file.
- --
- ---------------------------------------------------
- Don MacQueen macq@miguel.llnl.gov
- Lawrence Livermore Nat. Lab.
- 7000 East Ave., L-307 (510) 423-1062
- Livermore, CA 94550
- ---------------------------------------------------
-