Then it looks like you'll have to build an agonizingly long command into a 
variable and execute it.  For sure that will work.  Like:
SET VAR vCommand = ('SET VAR vnumdlrs = (COUNT(dlrname)) ...... AND '  + 
.activetype + ' < .vmonthend) ......' )&vCommand
You get the idea.  The hardest part is getting the vCommand right.
Karen

 
-----Original Message-----
From: Dan Goldberg <[email protected]>
To: [email protected] <[email protected]>
Sent: Tue, Dec 17, 2019 3:49 pm
Subject: RE: [RBASE-L] - using & in set var or select into statement

#yiv2032157359 #yiv2032157359 -- _filtered {} _filtered {} _filtered {} 
#yiv2032157359 #yiv2032157359 p.yiv2032157359MsoNormal, #yiv2032157359 
li.yiv2032157359MsoNormal, #yiv2032157359 div.yiv2032157359MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:sans-serif;} 
#yiv2032157359 a:link, #yiv2032157359 span.yiv2032157359MsoHyperlink 
{color:blue;text-decoration:underline;} #yiv2032157359 a:visited, 
#yiv2032157359 span.yiv2032157359MsoHyperlinkFollowed 
{color:purple;text-decoration:underline;} #yiv2032157359 
p.yiv2032157359msonormal0, #yiv2032157359 li.yiv2032157359msonormal0, 
#yiv2032157359 div.yiv2032157359msonormal0 
{margin-right:0in;margin-left:0in;font-size:11.0pt;font-family:sans-serif;} 
#yiv2032157359 p.yiv2032157359msonormal, #yiv2032157359 
li.yiv2032157359msonormal, #yiv2032157359 div.yiv2032157359msonormal 
{margin-right:0in;margin-left:0in;font-size:11.0pt;font-family:sans-serif;} 
#yiv2032157359 p.yiv2032157359msochpdefault, #yiv2032157359 
li.yiv2032157359msochpdefault, #yiv2032157359 div.yiv2032157359msochpdefault 
{margin-right:0in;margin-left:0in;font-size:11.0pt;font-family:sans-serif;} 
#yiv2032157359 span.yiv2032157359msohyperlink {} #yiv2032157359 
span.yiv2032157359msohyperlinkfollowed {} #yiv2032157359 
span.yiv2032157359emailstyle17 {} #yiv2032157359 span.yiv2032157359emailstyle19 
{} #yiv2032157359 p.yiv2032157359msonormal1, #yiv2032157359 
li.yiv2032157359msonormal1, #yiv2032157359 div.yiv2032157359msonormal1 
{margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:serif;} 
#yiv2032157359 p.yiv2032157359msonormal2, #yiv2032157359 
li.yiv2032157359msonormal2, #yiv2032157359 div.yiv2032157359msonormal2 
{margin:0in;margin-bottom:.0001pt;font-size:11.0pt;font-family:sans-serif;} 
#yiv2032157359 span.yiv2032157359msohyperlink1 
{color:#0563C1;text-decoration:underline;} #yiv2032157359 
span.yiv2032157359msohyperlinkfollowed1 
{color:#954F72;text-decoration:underline;} #yiv2032157359 
span.yiv2032157359emailstyle171 {color:windowtext;} #yiv2032157359 
span.yiv2032157359emailstyle191 
{color:black;font-weight:normal;font-style:normal;} #yiv2032157359 
p.yiv2032157359msochpdefault1, #yiv2032157359 li.yiv2032157359msochpdefault1, 
#yiv2032157359 div.yiv2032157359msochpdefault1 
{margin-right:0in;margin-left:0in;font-size:10.0pt;font-family:serif;} 
#yiv2032157359 span.yiv2032157359EmailStyle33 
{font-family:sans-serif;color:windowtext;} #yiv2032157359 
.yiv2032157359MsoChpDefault {font-family:sans-serif;} _filtered {} 
#yiv2032157359 div.yiv2032157359WordSection1 {} #yiv2032157359 Thx all.    I 
tried all of them except for the file output one. It doesn’t like you using the 
& in the where clause in the set var or select statements.    Dan Goldberg    
From: 'Karen Tellef' via RBASE-L <[email protected]>
Sent: Tuesday, December 17, 2019 12:54 PM
To: [email protected]
Subject: Re: [RBASE-L] - using & in set var or select into statement    One 
last suggestion, but this one is a stretch.  The syntax:      SET VAR vnumdlrs 
= (COUNT(dlrname)) IN dealer.....    is old syntax.  I know it still "works" 
but I don't think it's supported.  I never use that syntax anymore.    Maybe 
try the newer syntax:    SELECT (COUNT(dlrname)) INTO vnumdlrs FROM dealer..... 
         Karen             -----Original Message-----
From: Bill Eyring <[email protected]>
To: rbase-l <[email protected]>
Sent: Tue, Dec 17, 2019 2:02 pm
Subject: RE: [RBASE-L] - using & in set var or select into statement Dan   Try 
enclosing the entire expression in parenthesis like this;   SET VAR vnumdlrs =+ 
(+ (COUNT(dlrname)) IN dealer +      WHERE activelines CONTAINS .vactivelines 
AND dlrnum > 'cf000' +      AND ((activelines CONTAINS .vactivelines AND 
&activetype < .vmonend) +      OR (activelines1 = 'n' AND &canceltype > 
.vmonstart +      AND &activetype < .vmonstart))+ )   As Jan said, try running 
it from the R>prompt or a test file.   Here is some sample code that works for 
me;   --build where clause then;   SET V vwhere5=('and'&'('+.vwhere5+')') SET V 
vwhere=(.vwhere1&.vwhere2&.vwhere3&.vwhere4&.vwhere5) SET V vhowmany 
TEXT=.vwhere SET V vhowmany =('sel count idnum into vcount vi1 fro vacantland 
whe'&.vhowmany)   --output to a filename then run it   SET VAR vnewguid TEXT= 
(CVAL('GUID')) SET V vhowmanysearch=(.vnewguid+'.$$$') OUTPUT .vhowmanysearch 
WRITE .vhowmany WRITE 'ret' OUTPUT SCREEN RUN &vhowmanysearch   Bill Eyring     
From:[email protected] [mailto:[email protected]]On Behalf Of Dan 
Goldberg
Sent: Tuesday, December 17, 2019 1:34 PM
To: [email protected]
Subject: [RBASE-L] - using & in set var or select into statement   I am trying 
to use variable values for column names in set var and select statement and it 
gives me the error   -ERROR- An expression cannot begin with binary operator 
(2150)   If I replace the & variables with the column names it works.     Here 
is my set var command.   SET VAR vnumdlrs = (COUNT(dlrname)) IN dealer +      
WHERE activelines CONTAINS .vactivelines AND dlrnum > 'cf000' +      AND 
((activelines CONTAINS .vactivelines AND &activetype < .vmonend) +      OR 
(activelines1 = 'n' AND &canceltype > .vmonstart +      AND &activetype < 
.vmonstart))   Any blues clues on how I can do this?   Dan Goldberg --
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
[email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/2E4830CEC16615458329D3D83342F8D0011ECC99F6%40exchange11.
 --
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
[email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/000601d5b514%24def24390%249cd6cab0%24%40com.
 -- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
[email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/857815986.526104.1576616010618%40mail.yahoo.com.
 -- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/2E4830CEC16615458329D3D83342F8D0011ECCA877%40exchange11.

-- 
For group guidelines, visit 
http://www.rbase.com/support/usersgroup_guidelines.php
--- 
You received this message because you are subscribed to the Google Groups 
"RBASE-L" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/497350310.621804.1576620799454%40mail.yahoo.com.

Reply via email to