[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: A bug in where clause? (V8.2)
From:       "Huang, Ya" <ya.huang () PFIZER ! COM>
Date:       2002-07-31 22:37:22
[Download RAW message or body]

It dose look like a bug:

907  %let limit=199;
908  %let WHERE=%sysfunc(repeat(0, &limit));
909
910  data TOTO;
911  length x $1000;
912    x=repeat('0',199); output;
913  run;

NOTE: The data set WORK.TOTO has 1 observations and 1 variables.
NOTE: DATA statement used:
      real time           0.01 seconds
      cpu time            0.01 seconds


914
915  *-- Apply a simple where clause: --*;
916  data TITI;
917     set TOTO (where=(x = symget('where')));
918  run;

NOTE: There were 1 observations read from the data set WORK.TOTO.
      WHERE x=SYMGET('where');
NOTE: The data set WORK.TITI has 1 observations and 1 variables.
NOTE: DATA statement used:
      real time           0.01 seconds
      cpu time            0.01 seconds


919
920  %let limit=200;
921  %let WHERE=%sysfunc(repeat(0, &limit));
922
923  data TOTO;
924  length x $1000;
925    x=repeat('0',200); output;
926  run;

NOTE: The data set WORK.TOTO has 1 observations and 1 variables.
NOTE: DATA statement used:
      real time           0.01 seconds
      cpu time            0.01 seconds


927
928  *-- Apply a simple where clause: --*;
929  data TITI;
930     set TOTO (where=(x = symget('where')));
931  run;

NOTE: There were 0 observations read from the data set WORK.TOTO.
      WHERE x=SYMGET('where');
NOTE: The data set WORK.TITI has 0 observations and 1 variables.
NOTE: DATA statement used:
      real time           0.01 seconds
      cpu time            0.01 seconds




The cutoff point is 200. Looks like something to do with v6,
but this was run in v8.2/win.


-----Original Message-----
From: Xavier Autret [mailto:xav_x@NOOS.FR]
Sent: Wednesday, July 31, 2002 1:08 PM
To: SAS-L@LISTSERV.UGA.EDU
Subject: A bug in where clause? (V8.2)


Hello!

I m in V8.2 under UNIX and Windows.

A bug in where clause?

I want to know the length limit of a where clause...

My problem is that an application use the content of a macro variable as
a where clause. (the application don t use views don t tell me why...).

Under V8 the length of a macro variable value can be 32767 long.

So I wan t to allow the user to provide a macro variable of 32767 char.

BUT BUT BUT:

see that small pieace off code===> (CAUTION SAS halts!!!)

*-- works for limit = 628 --*;
%let limit=628;
%let WHERE=%sysfunc(repeat(0, &limit))1;

data TOTO;
  x=3;
run;

*-- Apply a simple where clause: --*;
data TITI;
   set TOTO(where=(not("0" = "&WHERE")));
run;

*-- !!!!! halts for limit > 628 --*;
%let limit=629;
%let WHERE=%sysfunc(repeat(0, &limit))1;

data TOTO;
  x=3;
run;

*-- Apply a simple where clause: --*;
data TITI;
   set TOTO(where=(not("0" = "&WHERE")));
run;

so what s is the limit?
is it OS dependent?
is it corrected in V9?

Xavier

ps: sorry for my poor english.....

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic