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 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/2E4830CEC16615458329D3D83342F8D0011ECC99F6%40exchange11
 
<https://groups.google.com/d/msgid/rbase-l/2E4830CEC16615458329D3D83342F8D0011ECC99F6%40exchange11?utm_medium=email&utm_source=footer>
 .

-- 
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.

Reply via email to