Date: Sun, 20 May 2012 21:29:22 -0700
Reply-To: Daniel Nordlund <djnordlund@FRONTIER.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Daniel Nordlund <djnordlund@FRONTIER.COM>
Subject: Re: insert blanks
In-Reply-To: <000001cd3701$e447d420$acd77c60$@com>
Content-Type: text/plain; charset="utf-8"
> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of bbser
> 2009
> Sent: Sunday, May 20, 2012 8:29 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Re: insert blanks
>
> Hi Dan,
>
> Definitely as you said, your suggestion about manipulating _infile_ (or
> using input statement to read the contents of _infile_) greatly improved
> my code.
> Thank you very much!
>
> BTW, I just feel strange, when x is numeric, neither setting _infile_=3
> nor setting _infile='3' causes problem for a subsequent input statement
> like "input x;" Interpretation?
>
> Best regards, Max
> (Maaxx)
>
Max,
I believe the explanation is that the _infile_ variable/buffer is a text structure, so it automatically converts the assigned value to character if it can. Maybe someone else can point you to proper documentation to that effect. I guess I was surprised that the assignment took place without an error or warning or at least a note that a conversion took place. I thought maybe it was just a special feature of _infile_, but then I tried this
data temp;
length y $3;
y = 100;
put _all_;
run;
proc print;
run;
Again, the assignment occurred without an error, warning or note.
Dan
Daniel Nordlund
Bothell, WA USA
|