|
On Wed, 24 Dec 2008 12:08:22 -0500, Ian Whitlock <iw1sas@GMAIL.COM> wrote:
>Howard wrote in part:
>
>>How about following up on an earlier suggestion to use the
>>@[character-literal] mechanism. This works:
>
>
>>data two;
>> infile csv("*.csv") dsd;
>> input @'Spreadsheet: xyz' ID $3. time $2.
>> @'"Average",' (2* AvgSatCals AvgProtein)($)
>> @'"% Recommendation",' (2*PctRecSatCals PctRecProtein)($)
>> ;
>> run;
>
>I was most surprised to see that the "2*" notation worked on the INPUT
>statement. It is documented for the PUT statement,
and there only preceding a character literal, I believe
>but is there any hint of its working on INPUT?
>
>Apparently it also work in this context, albeit not so useful.
>
> data _null_ ;
> input @3*'-' x ;
> put x= ;
> cards ;
> 1 2 ---3 4
> ;
It also seems to work on informats. I run this
data _null_;
input (Var1-Var6)( 2 * 1. 2 * $1. 2 * date9. );
put Var1-Var6;
cards;
34ab01Jan196024Dec2008
;
I see: 3 4 a b 0 17890
>
>
>--
>Ian Whitlock
|