Running OI7.21
I had to ressurect a set of 9 old RList commands in AREV for a client. No problem I thought. Well there appears to be a difference between Rlist in AREV and OI. There's probably something else, but this is what I found: See this Potential Parsing Issue in Rlist.
Any case my problem is as followed: When I just copied the Rlist statements into a Rlist call or into Slist, for certain Rlist commands I get error messages. For example, Rlist thinks that the (WITH is an invalid dictionary item.
Slist thinks that "0" is not a valid column name.
Below is the problem Rlist (notice the WITH OR and the AND WITH:
pre.code {
background-color: #E5E5E5;
border: 1px solid #000000;
width: 650px;
padding: 5px;
font-family: courier, verdana, arial, serif;
margin: 0px 10px auto;
}
LIST PATIENT_INFO (WITH CURR_INS_CARRIER EQ '1001' OR WITH CURR_INS_CARRIER EQ '1185') AND (WITH AGE GT '0' AND WITH AGE LT '1') BY AGE AGE COLHEAD'PATIENT AGES' JUSTLEN 'L12' TOTAL CNT COLHEAD'CNT' DET-SUPP ID-SUPPpre.code {
background-color: #E5E5E5;
border: 1px solid #000000;
width: 650px;
padding: 5px;
font-family: courier, verdana, arial, serif;
margin: 0px 10px auto;
}
TypeOverRide =DisplayThe errors seem to happen when there are combination of "ANDs" and "ORs". Is this is known issues? Is this being addressed? Or could there be an error in my Rlist?
Any comments welcome. Thanks,
Ray Chan
Opps forgot the bracket, but you can see the Rlist nevertheless.
pre.code {
background-color: #E5E5E5;
border: 1px solid #000000;
width: 650px;
padding: 5px;
font-family: courier, verdana, arial, serif;
margin: 0px 10px auto;
}
LIST PATIENT_INFO (WITH CURR_INS_CARRIER EQ '1001' OR WITH CURR_INS_CARRIER EQ '1185') AND (WITH AGE GT '0' AND WITH AGE LT '1') BY AGE AGE COLHEAD'PATIENT AGES' JUSTLEN 'L12' TOTAL CNT COLHEAD'CNT' DET-SUPP ID-SUPP
You need a space before and after the parenthesis but then RLIST only seems to parse the first set of parentheses properly any way.
OI is rather obnoxious about syntax (and backward in many ways).
You must use spaces around all parenthesis
You must use all caps for all system keywords (LIST, WITH, AND, LIMIT, etc) - the enhancement section says this is "fixed", but not so far (7.2.1).
I suspect that you need spaces around comparators such as "= also (if you EQ and LT, you already have this)..
Any single thing wrong and you may get an error msg or you may just be ignored (the usual SLIST behavior, but RLIST does it also). I had to edit a number of old RLIST commands to get them to transfer to OI (changing to caps, adding spaces around parens, stripping out text marks if just reading it from REPORTS, etc).
For complex criteria which are frequently used, consider a symbolic which returns "1" for items matching your criteria, or "0" otherwise, then select for records where the symbolic=1".
have you tried breaking it down to pieces?
]]LIST PATIENT_INFO (WITH CURR_INS_CARRIER EQ '1001' OR WITH CURR_INS_CARRIER EQ '1185') AND (WITH AGE GT '0' AND WITH AGE LT '1') BY AGE AGE COLHEAD'PATIENT AGES' JUSTLEN 'L12' TOTAL CNT COLHEAD'CNT' DET-SUPP ID-SUPP
instead of the OR WITH have you just ..
(WITH CURR_INS_CARRIER EQ '1001''1185')
Thanks for ALL the response. I played with various suggestions and for those that I did play with I came to the following conclusions:
RLIST does not always parse correctly when there are multiple WITHs and when there are mulitple parathenese. The multiple paranthesis may not be an issue what may be causing the problem is when parenthensis are used around the second set of WITH. We found that the Rlist will run in most cases, but will return the wrong results. If you're arn't aware of this limitaton this could be dangerous. See below:
Warren seems do have found problems with parsing as well.
Well I spent enough time trying to make this work. Maybe this should be fixed . RLIST is great, but it gotta be right. I'm sure all AREV & PICK programmers would appreciate this.
HTH,
Ray Chan
P.S. RTI is this on the list of things to fix or look? If you need more information, please let me know. I can call to discuss.
now that was pretty .. i thought the boxes were cool but oh my .. circle and arrow with a paragraph on the back explaining what each one is about .. oh wait .. that is arlo guthrie
did you put this in the problems section? Seems like a pretty serious limitation .. though rtp18 has taken some real hits over the years.
I remember all the work that Bob (i think it was bob .. bruce??) did in the lab to rip out all the crap indexing stuff that had been put in there .. oh my ..
btw .. i put this in the problem tracker
Thanks.
Your friend,
Ray
That last one has 1 1/2 sets of parentheses, i.e., one left, and two right. Did it really work like that?
No that was a typo. I didn't want to clutter things by issuing a correction. You have sharp eyes.
Ray Chan
Ray,
I had similar problems with multiple sets of parens and complex logic - where removing parens were not possible or caused extremely large increases in time to get final select list – all was fixed when I made absolutely sure that there were spaces before and after every parenthesis and operator (somthing that AREV never cared about, as that is a simple parsing problem …. but then again ….).
Karen,
As far as I could tell from the RLISTs that I was working with, it made no difference whether a space was there or not. Trust me, I tried so many different combinations.
It seems that Rlists does not like more than one set of "()" and if you have more than one set of WITH (e.g., 2) and put "()" around the second set of WITH, RLIST will misbehave. You can put () around the first set of WITH, but not the second. I didn't check for third or fourth .
We can be creative and workaround some of this, but overall this problem should be fixed. Dsig has put this in the problem area.
Hopefully, this can be fixed soon.
Ray Chan