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 (January 2003, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 31 Jan 2003 17:14:07 -0500
Reply-To:   "Gerstle, John" <yzg9@CDC.GOV>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   "Gerstle, John" <yzg9@CDC.GOV>
Subject:   Re: Importing tab delimited files
Comments:   To: Debbie Cooper <debbie.cooper@STEVENSONCOMPANY.COM>
Content-Type:   text/plain; charset="iso-8859-1"

Debbie, Try this work around. Create a test dataset with sample data in every field, maybe like 10 rows or so. Import into SAS, along with the other datasets. Append (via PROC APPEND) all the others to this sample dataset (i.e. BASE=SAMPLEDATASET). Then in a subsequent data step, delete all rows of the test data (IF SITE=test THEN DELETE). This gives you some control over how SAS will read in the other datasets. If variables don't match, you'll get messages in the log.

John Gerstle CDC Information Technological Support Contract (CITS) Biostatistician Phone: 404-639-3980 Fax: 404-639-2980 Cell: 770-639-5060 Email: jgerstle@cdc.gov

> -----Original Message----- > From: Debbie Cooper [mailto:debbie.cooper@STEVENSONCOMPANY.COM] > Sent: Friday, January 31, 2003 4:14 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Importing tab delimited files > > We will be receiving survey results in the form of tab delimited files > soon. > There will be about 180 files representing different products that we > research. The problem I'm having is that the files are being sent to me > in > tab-delimited format with the field names in the first row of the file. > The > data is such that if no respondent answers a particular question, that > field/column will not show up. So there won't be an empty space > representing no answer, the field simply won't be there. > > Because of this I've tried to use Proc Import to read the files but what's > happening is SAS reads each file and can potentially assign different > formats to the same fields in different files. Not only that but we have > a > few text fields (open-end questions) as well and SAS is apparantly looking > at the first record and deciding what length to give these fields, so > subsequent records can have the fields truncated. > > SAS tells me I need to use an INFILE statement to read these files and > that > makes sense except for the fact that I'll never know which fields will or > won't show up in the files. > > Any suggestions would be greatly appreciated. > > Thanks, > Debbie


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