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 (September 2005, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 9 Sep 2005 11:53:09 -0700
Reply-To:   Jerry <zhiweiwang@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jerry <zhiweiwang@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   Re: How to input data from different column for different rows
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset="iso-8859-1"

Thank you all guys for your comments. Thank you, Barry, David and Toby.

Maybe my example has made some confusion. By using A, B, c, I only want to indicate the position from which I want to begin reading in data. It does not have to be alphabets. In fact, (as suggested by David) here is a portion of the real data set I am dealing with:

M 20 S 13 MN X 20 S 13 MN ST,20,S,13,MN M20S13MN M 26 M 1 IN X 216 M 15 WI DE,26,M,15,WI M26M15WI M 27 . 11 MN 034 2 . 05 MN EC,27,,05,MN M205MN M . S 14 IA O . S 14 IA CD,,S,14,IA MS14IA

Okay, Suppose I want to read in data from the column that has values of "ST, DE, EC, CD". The data before that is gabage. Note that the wider gap is "tab" charactor instead of "space" charactor. Therefore, although it seems that the "ST" is aligned, it is actually not aligned in the same column. The "," is the delimiter of the third block and needs to be removed.

what I have tried to do is to set "@17 dlm='092c'x dsd" option in the "infile" statement. but @17 is surely not suitable because it actually starts from different columns.

Hope you can give me some clues. Thank you.

David L Cassell wrote:

> > Your question is NOT stupid. Reading in flat files can be painfully hard. > And learning all the input tricks that the SAS data step has can take a > while. > > There's a lot of features to list and formatted input that you may not know > yet. You can mix column input, list input, named input, and column input. > There are a host of ways to movethe pointer and tell the system which > pieces to look for. > > So if you could write back to SAS-L and supply, say, 10 or 15 lines of > your actual data (or modify things enough that the lines don't wrap but > your probolem is clearer), then someone on SAS-L is likely to know a > technique > or five that could help you. > > David > -- > David L. Cassell > mathematical statistician > Design Pathways > 3115 NW Norwood Pl. > Corvallis OR 97330 > > _________________________________________________________________ > Express yourself instantly with MSN Messenger! Download today - it's FREE! > http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/


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