home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / bit / listserv / sasl / 5448 < prev    next >
Encoding:
Text File  |  1992-12-21  |  1.3 KB  |  39 lines

  1. Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU
  2. Path: sparky!uunet!spool.mu.edu!darwin.sura.net!paladin.american.edu!auvm!ATTMAIL.COM!JADETECH
  3. Content-Type: text
  4. Message-ID: <SAS-L%92122112004041@UGA.CC.UGA.EDU>
  5. Newsgroups: bit.listserv.sas-l
  6. Date:         Mon, 21 Dec 1992 16:46:21 GMT
  7. Reply-To:     jadetech@ATTMAIL.COM
  8. Sender:       "SAS(r) Discussion" <SAS-L@UGA.BITNET>
  9. From:         jadetech@ATTMAIL.COM
  10. Subject:      Reading Variable Length Binary Files
  11. Comments: To: SAS-L@uga.cc.uga.edu
  12. Lines: 25
  13.  
  14. Thanks to Melvin Klassen and J. Philip Miller for their help.  Also thanks
  15. to Bill Calvert who (unknowingly) gave me the key to solving the problem.
  16. I happened to look at Bill's paper which will be given at SESUG '93 in
  17. February, which has an example similar to the problem I posed.  Thanks all.
  18.  
  19. For the record, what follows is an abbreviated version of the code that
  20. I found works.  The problem was reading a binary PC file with variable
  21. length records and no end of record marker:
  22.  
  23. DATA PCFILE ;
  24.   INFILE BINARY RECFM=N LRECL=2048 END=EOF ;
  25.   DO UNTIL (EOF) ;
  26.      INPUT len pib1.
  27.            text $varying200. len @ ;
  28.     OUTPUT ;
  29.   END;
  30. RUN ;
  31.  
  32. Simple, yet the key was the combination of the RECFM=N and LRECL ;
  33. Thanks again for the help.
  34.  
  35. S. David Riba
  36. JADE Tech, Inc.
  37.  
  38. JADETECH@ATTMAIL.COM
  39.