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]<mailto:[email protected]>>
To: rbase-l <[email protected]<mailto:[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]> 
[mailto:[email protected]] On Behalf Of Dan Goldberg
Sent: Tuesday, December 17, 2019 1:34 PM
To: [email protected]<mailto:[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]<mailto:[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]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/000601d5b514%24def24390%249cd6cab0%24%40com<https://groups.google.com/d/msgid/rbase-l/000601d5b514%24def24390%249cd6cab0%24%40com?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]<mailto:[email protected]>.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/rbase-l/857815986.526104.1576616010618%40mail.yahoo.com<https://groups.google.com/d/msgid/rbase-l/857815986.526104.1576616010618%40mail.yahoo.com?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/2E4830CEC16615458329D3D83342F8D0011ECCA877%40exchange11.

Reply via email to