LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (October 1997, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 30 Oct 1997 09:09:40 -0800
Reply-To:   "kmself@ix.netcom.com" <kmself@ix.netcom.com>
Sender:   "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From:   "Karsten M. Self" <kmself@IX.NETCOM.COM>
Organization:   Self Analysis
Subject:   Re: help: converting PC binary file to SAS dataset
Comments:   To: See-Wong Shum <shum@PANIX.COM>
Content-Type:   text/plain; charset="us-ascii"

On Thursday, October 30, 1997 8:36 AM, See-Wong Shum [SMTP:shum@PANIX.COM] wrote: > I have trouble in converting a PC binary file into SAS dataset > I am running Window 95 SAS 6.12 > > The PC binary file which is 525,178,647 bytes > has the following documentation: > > 567 > "a",C,1,1,0,1,0 > "b",I,79,4,0,9,0 > "c",F,564,4,0,9,1 > > I guess "a", "b" and "c" are variable names, > C stands for character; "I" stands for Integer; and "F" for floating > point; > The first numeric for the starting position; > and the second for the length. > > Please help me out. Thank you in advance.

This doesn't mean much without specific information on what is actually in the file, as opposed to what the alleged documentation says is in the file.

This looks from the description to be an ascii file. Your first step is to view the file (or the first few records). If you see something like: a 0000 23.23423 a 0000 23.23423 ...then you've got a flat ascii file. Read the appropriate sections of the SAS Language, Reference manual on INFORMATS and INPUT statements for instructions on how to manage this.

If you see something which looks like a bunch of square boxes and garbage characters (in a text editor) or with non-ascii hex or octal values (in a hex or octal-capable editor), you have a true binary file. A sample might look like (results will vary depending on your mailer):

?_ aI yyyy?q .h %h |') ? ?% ;!,

In this case, find out from the source what the description file actually means, or break the file bit by bit, again using SAS informats.

A hex or ascii dump of the first few records would be more meaninfgul than just looking at the description file.

Karsten M. Self (kmself@ix.netcom.com)

What part of "gestalt" don't you understand? (Welchen Teil von <<Gestalt>> verstehn Sie nicht?)


Back to: Top of message | Previous page | Main SAS-L page