home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #20 / NN_1992_20.iso / spool / bit / listserv / sasl / 4102 < prev    next >
Encoding:
Internet Message Format  |  1992-09-09  |  2.1 KB

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