LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (September 2007, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
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 <gerhard.hellriegel@T-ONLINE.DE> wrote:

>Why do you need the LENGTH option? >For CHAR variable, you simply use > > char(40)

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.

>Gerhard > > >On Sun, 30 Sep 2007 07:20:48 -0700, Hari <excel_hari@YAHOO.COM> wrote: > >>Hi, >> >>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). >> >>"LENGTH=length >>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 >>feature. >> >>Any thoughts? >> >>hp

Back to: Top of message | Previous page | Main SAS-L page