home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #3 / NN_1993_3.iso / spool / bit / listserv / sasl / 5763 < prev    next >
Encoding:
Text File  |  1993-01-27  |  1.6 KB  |  49 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!uvaarpa!darwin.sura.net!paladin.american.edu!auvm!SMUVM1.BITNET!UDCW
  3. Organization: Southern Methodist University
  4. Message-ID: <SAS-L%93012614335938@UGA.CC.UGA.EDU>
  5. Newsgroups: bit.listserv.sas-l
  6. Date:         Tue, 26 Jan 1993 13:32:18 CST
  7. Reply-To:     UDCW@SMUVM1.BITNET
  8. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  9. From:         UDCW@SMUVM1.BITNET
  10. Subject:      COMMA DELIMITED ASCII FILES (the solution)
  11. Lines: 36
  12.  
  13. Several people have helped me find a solution to my earlier posting.
  14. I would like to thank each of them; they are:
  15.  
  16.    Howard Schreier, Derek Morgan, Joe St Sauver, and Kernon Gibes
  17.  
  18. Here is my earlier post:
  19.  
  20. > I have an ASCII file that is delimited by commas and quotation marks(").
  21. > Numeric and character variables are both separated by commas except
  22. > when a character variable contains commas then the entire text string
  23. > is enclosed in quotation marks.  For example,
  24. >
  25. > 12,54,67,"Welch,David",34,3,the big dog
  26. >
  27. > Is there an easy way to read a file like this in SAS?  There are an
  28. > equal number of variables on each record and all variables are
  29. > ordered, but they are not fixed width.
  30. >
  31.  
  32. The following program reads the file:
  33.  
  34.  
  35. filename data 'comma data a';
  36.  
  37. data one;
  38.   INFILE data DSD;
  39.   INPUT A B C D  & $char30.  E F G & $char30.;
  40.  
  41. Thanks again for the help.  BTW, this option (DSD) is documented in
  42. Tech Report P-222 page 30 and is for version 6.07.
  43.  
  44. Sincerely,
  45. David Welch
  46. Senior Systems Analyst
  47. Southern Methodist University                            UDCW @ vm.cis.smu.edu
  48. (214) 692-2036                                         dwelch @ sun.cis.smu.edu
  49.