From: Joe Matise on 1 Jan 2010 22:40 VARCHAR is a SQL data type. SAS has character variables, just not called VARCHAR. If you're noting that SAS doesn't have variable length characters, look at COMPRESS dataset/system option; make your characters long enough, and then COMPRESS will make the space that wasn't being used go away. SAS doesn't natively do this, presumably for reasons of simplicity of storage [knowing how big each row is ahead of time allows it to specify how much storage space to use]. -Joe On Fri, Jan 1, 2010 at 9:31 PM, Wensui Liu <liuwensui(a)gmail.com> wrote: > i couldn't find any evidence that sas/base supports varchar data type. > a little surprise though. > any insight or experience? > > thank you so much and have a happy 2010! >
From: Wensui Liu on 1 Jan 2010 22:46 joe varchar is character data type of indeterminate length. try this proc sql; create table test(TEXT varchar); insert into test values('1234567890'); quit; On Fri, Jan 1, 2010 at 10:40 PM, Joe Matise <snoopy369(a)gmail.com> wrote: > VARCHAR is a SQL data type. SAS has character variables, just not called > VARCHAR. If you're noting that SAS doesn't have variable length characters, > look at COMPRESS dataset/system option; make your characters long enough, > and then COMPRESS will make the space that wasn't being used go away. SAS > doesn't natively do this, presumably for reasons of simplicity of storage > [knowing how big each row is ahead of time allows it to specify how much > storage space to use]. > > -Joe > > On Fri, Jan 1, 2010 at 9:31 PM, Wensui Liu <liuwensui(a)gmail.com> wrote: >> >> i couldn't find any evidence that sas/base supports varchar data type. >> a little surprise though. >> any insight or experience? >> >> thank you so much and have a happy 2010! > > -- ============================== WenSui Liu Blog : statcompute.spaces.live.com Tough Times Never Last. But Tough People Do. - Robert Schuller ==============================
From: Joe Matise on 1 Jan 2010 23:02 I know that. Reread my post, the bit after the second sentence. SAS has ways of approaching this, but does not [for, I believe, the reason I stated] simply allow undefined length character. -Joe On Fri, Jan 1, 2010 at 9:46 PM, Wensui Liu <liuwensui(a)gmail.com> wrote: > joe > varchar is character data type of indeterminate length. try this > proc sql; > create table test(TEXT varchar); > insert into test values('1234567890'); > quit; > > > On Fri, Jan 1, 2010 at 10:40 PM, Joe Matise <snoopy369(a)gmail.com> wrote: > > VARCHAR is a SQL data type. SAS has character variables, just not called > > VARCHAR. If you're noting that SAS doesn't have variable length > characters, > > look at COMPRESS dataset/system option; make your characters long enough, > > and then COMPRESS will make the space that wasn't being used go away. > SAS > > doesn't natively do this, presumably for reasons of simplicity of storage > > [knowing how big each row is ahead of time allows it to specify how much > > storage space to use]. > > > > -Joe > > > > On Fri, Jan 1, 2010 at 9:31 PM, Wensui Liu <liuwensui(a)gmail.com> wrote: > >> > >> i couldn't find any evidence that sas/base supports varchar data type. > >> a little surprise though. > >> any insight or experience? > >> > >> thank you so much and have a happy 2010! > > > > > > > > -- > ============================== > WenSui Liu > Blog : statcompute.spaces.live.com > Tough Times Never Last. But Tough People Do. - Robert Schuller > ============================== >
From: Arthur Tabachneck on 1 Jan 2010 23:20 Wensui, Take a look at: http://books.google.ca/books? id=uZYn6unDVtoC&pg=PT688&lpg=PT688&dq=sas+equivalent+varchar&source=bl&ots=r 0a99KO47m&sig=6o_TIGSeiCe5-YdGy5-qnAcKqsw&hl=en&ei=lcg- S6vdLszJlAfJu8yjBw&sa=X&oi=book_result&ct=result&resnum=2&ved=0CA4Q6AEwAQ#v= onepage&q=sas%20equivalent%20varchar&f=false or, in short form: http://xrl.us/bgrsyh Art ------- On Fri, 1 Jan 2010 22:46:44 -0500, Wensui Liu <liuwensui(a)GMAIL.COM> wrote: >joe >varchar is character data type of indeterminate length. try this >proc sql; >create table test(TEXT varchar); >insert into test values('1234567890'); >quit; > > >On Fri, Jan 1, 2010 at 10:40 PM, Joe Matise <snoopy369(a)gmail.com> wrote: >> VARCHAR is a SQL data type. SAS has character variables, just not called >> VARCHAR. If you're noting that SAS doesn't have variable length characters, >> look at COMPRESS dataset/system option; make your characters long enough, >> and then COMPRESS will make the space that wasn't being used go away. SAS >> doesn't natively do this, presumably for reasons of simplicity of storage >> [knowing how big each row is ahead of time allows it to specify how much >> storage space to use]. >> >> -Joe >> >> On Fri, Jan 1, 2010 at 9:31 PM, Wensui Liu <liuwensui(a)gmail.com> wrote: >>> >>> i couldn't find any evidence that sas/base supports varchar data type. >>> a little surprise though. >>> any insight or experience? >>> >>> thank you so much and have a happy 2010! >> >> > > > >-- >============================== >WenSui Liu >Blog : statcompute.spaces.live.com >Tough Times Never Last. But Tough People Do. - Robert Schuller >==============================
From: Wensui Liu on 1 Jan 2010 23:32
as always, thank you so much, art! see the following code. is there a generic way to read the full string into table without specify the length? proc sql; CREATE TABLE test(TEXT varchar); insert into test values ('1234567890'); quit; On Fri, Jan 1, 2010 at 11:20 PM, Arthur Tabachneck <art297(a)netscape.net> wrote: > Wensui, > > Take a look at: > http://books.google.ca/books? > id=uZYn6unDVtoC&pg=PT688&lpg=PT688&dq=sas+equivalent+varchar&source=bl&ots=r > 0a99KO47m&sig=6o_TIGSeiCe5-YdGy5-qnAcKqsw&hl=en&ei=lcg- > S6vdLszJlAfJu8yjBw&sa=X&oi=book_result&ct=result&resnum=2&ved=0CA4Q6AEwAQ#v= > onepage&q=sas%20equivalent%20varchar&f=false > > or, in short form: http://xrl.us/bgrsyh > > Art > ------- > On Fri, 1 Jan 2010 22:46:44 -0500, Wensui Liu <liuwensui(a)GMAIL.COM> wrote: > >>joe >>varchar is character data type of indeterminate length. try this >>proc sql; >>create table test(TEXT varchar); >>insert into test values('1234567890'); >>quit; >> >> >>On Fri, Jan 1, 2010 at 10:40 PM, Joe Matise <snoopy369(a)gmail.com> wrote: >>> VARCHAR is a SQL data type. SAS has character variables, just not called >>> VARCHAR. If you're noting that SAS doesn't have variable length > characters, >>> look at COMPRESS dataset/system option; make your characters long enough, >>> and then COMPRESS will make the space that wasn't being used go away. > SAS >>> doesn't natively do this, presumably for reasons of simplicity of storage >>> [knowing how big each row is ahead of time allows it to specify how much >>> storage space to use]. >>> >>> -Joe >>> >>> On Fri, Jan 1, 2010 at 9:31 PM, Wensui Liu <liuwensui(a)gmail.com> wrote: >>>> >>>> i couldn't find any evidence that sas/base supports varchar data type. >>>> a little surprise though. >>>> any insight or experience? >>>> >>>> thank you so much and have a happy 2010! >>> >>> >> >> >> >>-- >>============================== >>WenSui Liu >>Blog : statcompute.spaces.live.com >>Tough Times Never Last. But Tough People Do. - Robert Schuller >>============================== > -- ============================== WenSui Liu Blog : statcompute.spaces.live.com Tough Times Never Last. But Tough People Do. - Robert Schuller ============================== |