|Date: ||Mon, 5 Mar 2001 09:31:32 -0500|
|Reply-To: ||Sigurd Hermansen <HERMANS1@WESTAT.COM>|
|Sender: ||"SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>|
|From: ||Sigurd Hermansen <HERMANS1@WESTAT.COM>|
|Subject: ||Re: how can I change the maximum length of a variable ?|
|Content-Type: ||text/plain; charset="iso-8859-1"|
First let me assure you that your English is better than my French! Also,
although Charles Patridge has already posted a workable solution, you are
asking an interesting question.
If I had not seen the eight-character maximum for default string input, I
would not have guessed a default value of eight. Why eight? I have no
idea, other than perhaps a case of forced consistency between the default
lengths of character and numeric data types in SAS.
Except for the odd default value, the basic string INPUT statement does a
remarkably good job of parsing a data stream. It sets a default of
"delimiter=blank" as well as "length xxxx $ 8" for each character variable.
/* length prenom $ 8 nom $ 8 ; */
/* infile cards delimiter=blank; */
input prenom $ nom $ ;
comments out the defaults. You should understand them nonetheless. Try
changing the LENGTH's to 20 and 50 and removing the comment escape
operators. With that change your program works as expected. (Viola!???).
It usually makes sense to specify variable lengths and delimiters and not
leave the choices to the data step compiler. Compilers don't understand the
context of your program. Sig
Sent: Sunday, March 04, 2001 2:29 PM
Subject: how can I change the maximum length of a variable ?
first I have to warn you that I am french (so I can't speak english
very well). Moreover I'm a beginner so excuse me for my question
(which must be easy for you).
I use SAS system release 8.01
I would like to know how to have a text variable with a length of
more than eight characters.
My example is :
input prenom $ nom $;
this prints :
Obs prenom nom
1 françois beretti
2 robert delatail
so the string "delataillande" is changed in "delatail", and I don't
I would also like to know what are the "format", "informat" and "length"
keywords (in the definition of a variable) used for and
how they are used.
Can anyone help me ?
Thanks in advance
Sent by fberetti from ireste within area fr
This is a spam protected message. Please answer with reference header.
Posted via http://www.usenet-replayer.com/cgi/content/new