|
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 *****
******************************************************;
|