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

#yiv7864327230 #yiv7864327230 -- _filtered {} _filtered {} _filtered {} 
#yiv7864327230 #yiv7864327230 p.yiv7864327230MsoNormal, #yiv7864327230 
li.yiv7864327230MsoNormal, #yiv7864327230 div.yiv7864327230MsoNormal 
{margin:0in;margin-bottom:.0001pt;font-size:11.0pt;} #yiv7864327230 a:link, 
#yiv7864327230 span.yiv7864327230MsoHyperlink 
{color:#0563C1;text-decoration:underline;} #yiv7864327230 a:visited, 
#yiv7864327230 span.yiv7864327230MsoHyperlinkFollowed 
{color:#954F72;text-decoration:underline;} #yiv7864327230 p 
{margin-right:0in;margin-left:0in;font-size:12.0pt;font-family:New;} 
#yiv7864327230 span.yiv7864327230EmailStyle17 {color:windowtext;} 
#yiv7864327230 span.yiv7864327230EmailStyle19 
{color:black;font-weight:normal;font-style:normal;} #yiv7864327230 
.yiv7864327230MsoChpDefault {font-size:10.0pt;} _filtered {} #yiv7864327230 
div.yiv7864327230WordSection1 {} #yiv7864327230 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=.vwhereSET 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 
.vhowmanysearchWRITE .vhowmanyWRITE 'ret'OUTPUT SCREENRUN &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 
to [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 
to [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 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/857815986.526104.1576616010618%40mail.yahoo.com.

Reply via email to