Expressions on the Left
Deskin, Bob
Bob.Deskin@Cognos.COM
Thu, 4 Jun 1998 21:44:53 -0400
I've asked this before (of the "creators") and it took a couple of days
to remember the answer. Now remember that we're dealing with a parser
that's many years old and not all that bright. The problem is that the
parser works left to right. But generally, it does not go backwards or
remember specifically what came before. If you have an expression on the
left, what type is it supposed to be? Character, numeric, or date?
There's no way of knowing as you parse the expression whether the
combination and result is correct. You won't know that until you parse
both the left and right sides. But by then it's too late to signal an
error and give the expected list. Remember I said we're dealing with an
old parser here. So it was decided to ensure that the left side was a
known type and then the right side could be parsed as to a known type as
well.
A few years ago (somewhere between 5 and 10), we looked into changing
things. No matter what we thought about doing, the cost was too high
somewhere down the line. Whether it was stability or resources or
whatever. The bottom line is that this is the way it's probably going to
stay.
But at least you know why.
Bob Deskin
Senior Product Advisor bob.deskin@cognos.com
Cognos Inc. (613) 738-1338 ext 4205 FAX: (613) 228-3149
3755 Riverside Drive P.O. Box 9707 Stn. T, Ottawa ON K1G 4K9 CANADA
> ----------
> From: Hamilton, Allison[SMTP:Allison.Hamilton@cognos.com]
> Sent: June 3, 1998 3:11 PM
> To: powerh-l@lists.swau.edu; 'rshah@mcp.com'
> Subject: RE: Re[2]: QUICK - Bridge
>
> Roshan
> I suppose the simplest answer is that 'twas ever thus. Yes, I know
> that's not a very good answer. When I first joined COGNOS, I think I
> did figure out why this happened but that was a decade ago, and I've
> forgotten. This is one of the PowerHouse folklore tidbits that I've
> used for 19 years now (yes, I've been a QUIZ user for that long!) and
> it's just become habit to code things with the expression on the
> right.
> It does pose a problem if you want to compare two expressions though!
> You sometimes have to put one into a temporary and compare the temp
> with
> the second expression.
> Allison Hamilton
>
> > ----------
> > From: rshah@mcp.com[SMTP:rshah@mcp.com]
> > Sent: Wednesday, June 03, 1998 4:40 PM
> > To: powerh-l@lists.swau.edu; Conley; Steve
> > Subject: Re[2]: QUICK - Bridge
> >
> > Thanks Steve,
> >
> > It works this way without introducing any new variables...
> >
> > QUESTION to COGNOS - Why is it so ??
> >
> > Why does ( Expr > Value ) not work
> >
> > and
> >
> > ( value < Expr ) work ??
> >
> >
> > Roshan
> >
> >
> > ______________________________ Reply Separator
> > _________________________________
> > Subject: RE: QUICK - Bridge
> > Author: "Conley; Steve" <SConley@VICTORIA.COM> at internet
> > Date: 6/3/98 1:29 PM
> >
> >
> > Roshan,
> >
> > I believe that you have to move your equation to the other side of
> the
> >
> > operator. Notice that the sample code does not compile until I put
> > the
> > arithmetic operation to the right side of the > sign. I have always
> > had
> > more success with any calculations to the right side.
> >
> > VSSDAC-->TY TESTQKS.LIS
> > > SCREEN RCPTCTL
> > > FILE RCPTCTL
> > > FIELD PO_RCTL OF RCPTCTL
> > > PROCEDURE INIT
> > > BEGIN
> > > IF ((1*50) > PO_RCTL)
> > ^
> > *E* Expected: < = > GT LT EQ LE GE NE EXISTS IS MISSING
> > NULL
> > ^
> > > THEN BEGIN
> > > INFO "IT WORKS"
> > > END
> > > END
> > > REV
> >
> > change with calc on right side of comparison!!!!
> >
> > CAN CLE
> > SCREEN RCPTCTL
> > FILE RCPTCTL
> > FIELD PO_RCTL OF RCPTCTL
> > PROCEDURE INIT
> > BEGIN
> > IF (PO_RCTL < (1*50))
> > THEN BEGIN
> > INFO "IT WORKS"
> > END
> > END
> >
> >
> > > -----Original Message-----
> > > From: rshah@mcp.com [SMTP:rshah@mcp.com]
> > > Sent: Wednesday, June 03, 1998 2:51 PM
> > > To: powerh-l@lists.swau.edu
> > > Subject: QUICK - Bridge
> > >
> > > Hello Listers
> > >
> > > During the Compilation of QUICK Screens .... the floowing
> piece
> > of
> > > code gives me error
> > >
> > >
> > > Y2KARRSB at the end of the line shows the new code added....
> > >
> > >
> > >
> > > IF PY-TYPE OF ORDER-HEADER = 9 AND OH-PAYTYPE NE 3 AND PY-FLAG
> LT
> > 1
> > > THEN BEGIN
> > > LET CU-CUSTNO OF AR-AUDIT-CASH = CU-BILLTO OF
> > ORDER-HEADER
> > > LET IV-NUMBER OF AR-AUDIT-CASH = IV-NUMBER OF
> > ORDER-HEADER
> > > LET CU-NAME OF AR-AUDIT-CASH = CU-NAME OF CUSTOMER
> > > IF (( MOD( FLOOR( AU-CHECKDATE OF ORDER-HEADER / 10000) &
> > ;Y2KARRSB
> > > ,100 )) < 50 )
> > ;Y2KARRSB
> > > THEN BEGIN
> > ;Y2KARRSB
> > > LET AR-YEAR OF AR-AUDIT-CASH = &
> > > 2000 + MOD( FLOOR(AU-CHECKDATE OF ORDER-HEADER /
> > 10000)&;Y2KARRSB
> > > , 100)
> > ;Y2KARRSB
> > > END
> > ;Y2KARRSB
> > >
> > >
> > >
> > > ....
> > > ....
> > >
> > >
> > >
> > > I get the Error after IF (( MOD ( FLoor
> > >
> > >
> > > Any help appreciated well in advance...
> > >
> > > Roshan
> > > = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> =
> > = = =
> > > =
> > > Subscribe: "subscribe powerh-l" in message body to
> > > majordomo@lists.swau.edu
> > > Unsubscribe: "unsubscribe powerh-l" in message to
> > majordomo@lists.swau.edu
> > > powerh-l@lists.swau.edu is gatewayed one-way to
> > bit.listserv.powerh-l
> > > This list is closed, thus to post to the list, you must be a
> > subscriber.
> > = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> =
> > = = =
> > Subscribe: "subscribe powerh-l" in message body to
> > majordomo@lists.swau.edu
> > Unsubscribe: "unsubscribe powerh-l" in message to
> > majordomo@lists.swau.edu
> > powerh-l@lists.swau.edu is gatewayed one-way to
> bit.listserv.powerh-l
> > This list is closed, thus to post to the list, you must be a
> > subscriber.
> > = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> =
> > = = =
> > Subscribe: "subscribe powerh-l" in message body to
> > majordomo@lists.swau.edu
> > Unsubscribe: "unsubscribe powerh-l" in message to
> > majordomo@lists.swau.edu
> > powerh-l@lists.swau.edu is gatewayed one-way to
> bit.listserv.powerh-l
> > This list is closed, thus to post to the list, you must be a
> > subscriber.
> >
> = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
> = = =
> Subscribe: "subscribe powerh-l" in message body to
> majordomo@lists.swau.edu
> Unsubscribe: "unsubscribe powerh-l" in message to
> majordomo@lists.swau.edu
> powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
> This list is closed, thus to post to the list, you must be a
> subscriber.
>
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
Subscribe: "subscribe powerh-l" in message body to majordomo@lists.swau.edu
Unsubscribe: "unsubscribe powerh-l" in message to majordomo@lists.swau.edu
powerh-l@lists.swau.edu is gatewayed one-way to bit.listserv.powerh-l
This list is closed, thus to post to the list, you must be a subscriber.