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 2001, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Sat, 13 Jan 2001 18:49:33 +0000
Reply-To:   Puddin' Man <pudding_man@POSTMARK.NET>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Puddin' Man <pudding_man@POSTMARK.NET>
Subject:   How to pick up numbers from a text file intelligently?
Content-Type:   text/plain; charset="iso-8859-1"

Suliu,

I assume that the text to be read consists of one or more series of the eight lines of text between the dashed lines in your query ...

This data is _not_ logically constructed. I assume it was prepared by someone else. I doubt that you should count such folks as "friends". Did they happen to attempt to poison your coffee or somesuch when they dropped the data off? <grin>

Such data may present an opportunity to demonstrate the flexibility of the INPUT statement with regard to line numbers. The following Win2k SAS 8.1 log illustrates:

323 data a(keep=X_bar Y_bar lo_bnd hi_bnd); 324 infile cards n=8 missover; 325 array x(12); 326 input #1 @1 dum $; 327 if dum=:'X_bar' then do line=2 to 3; 328 input #line @1 X_bar Y_bar x1-x6;; 329 input #(line+4) @20 x7-x12; 330 link pickoff; 331 end; 332 return; 333 334 pickoff: 335 lo_bnd=x(floor(X_bar)); 336 hi_bnd=x(floor(X_bar)+1); 337 *** Y_thang=f(Y_bar,lo_bnd,hi_bnd); *** <--- add your code ***; 338 put X_bar= Y_bar= lo_bnd= hi_bnd=; *** for testing only ***; 339 output; 340 return; 341 342 cards;

X_bar=4.3 Y_bar=5.6 lo_bnd=4.9 hi_bnd=5.8 X_bar=10.99 Y_bar=13.01 lo_bnd=10.01 hi_bnd=11.01 NOTE: The data set WORK.A has 2 observations and 4 variables. NOTE: DATA statement used: real time 0.06 seconds cpu time 0.06 seconds

Hope this is helpful ...

Puddin'

"I wore my .44 so long it made my shoulder sore." - from ".44 Blues", Leothis "Lee" Green, around 1927

******************************************************* *** Puddin' Man *** Pudding_Man@postmark.net ***** ******************************************************;


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