Date: Sun, 30 Sep 2007 11:20:32 -0400
Reply-To: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject: Re: CREATE TABLE by defining columns and LENGTH = column modifier
On Sun, 30 Sep 2007 10:52:26 -0400, Gerhard Hellriegel
>Why do you need the LENGTH option?
>For CHAR variable, you simply use
Exactly. This is the conventional SQL syntax, using parentheses to bind the
length specification (which is somewhat confusingly called "WIDTH" in the
documentation) to the data type specification. In the SELECT context, there
is no data type specification, so the LENGTH= option is allowed.
>to define a 4-byte char
Gerhard meant 40, I think.
>and for numerics it does not make sense to restrict
>the 8 bytes to anything shorter.
Sometimes it does make sense, but PROC SQL does not provide a way to do this
when you declare a table structure. All numerics are allocated 8 bytes.
>On Sun, 30 Sep 2007 07:20:48 -0700, Hari <excel_hari@YAHOO.COM> wrote:
>>In SAS, when a new table (with no rows) is defined using CREATE TABLE
>>statement by defining columns, then it doesnt allow the Length column
>>modifier (only allowed in SELECT).
>>specifies the length of the column. This column modifier is valid only
>>in the context of a SELECT statement."
>>Whats the logic behind the same?
>>I expected all meta-data elements of a column to be defined using this