[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index]
[Date Index]
[Thread Index]
[SQR-USERS Info]
[SQRUG Home Page]
RE: [sqr-users] comparing with zero's
Use the round function which is in sqr documentation.
Begin-Program
begin-select
12.22 &d1
12.22 &d2
from dual
end-select
let #x = &d1
let #y = &d2
let #y = #y + 10.122 - 10.122
If round(#x,2) <> round(#y,2)
show 'rounded unequal'
show 'x <> y'
show 'x = ' #x
Show 'y = ' #y
else
Show 'rounded equal'
show 'x = y'
show 'x = ' #x
show 'y = ' #y
end-if
if #y <= (#x + 0.0001) and #y >= (#x - 0.0001)
show 'x ' #x ' sufficiently close to y ' #y
end-if
!***********
begin-select
12.22 &r1
12.22 &r2
let #a = &r1
let #b = &r2
let #b = #b + 10.122 - 10.122
If #a <> #b
show 'not rounded unequal'
show 'a <> b'
show 'a = ' #a
Show 'b = ' #b
else
Show 'not rounded equal'
show 'a = b'
show 'a = ' #a
show 'b = ' #b
end-if
from dual
end-select
end-Program
-----Original Message-----
From: sqr-users-admin@sqrug.org [mailto:sqr-users-admin@sqrug.org] On Behalf Of
Alexander, Steve
Sent: Wednesday, November 19, 2003 1:26 PM
To: 'sqr-users@sqrug.org'
Subject: RE: [sqr-users] comparing with zero's
Or:
if range(#temp - #temp1, -0.001, 0.001) = 1
do xyz
end-if
-----Original Message-----
From: Larry Roux [mailto:LRoux@syr.edu]
Sent: Wednesday, November 19, 2003 10:18 AM
To: sqr-users@sqrug.org
Subject: Re: [sqr-users] comparing with zero's
SQR has a known problem where there are sometimes values WAY down into the
decimal portion of the variable (ie 1.05 might be stored as
1.05000000000000000002)
try something like:
if edit(#temp,'9999999.999999') = edit(#temp1,'9999999.999999')
do xyz
end-if
******************************
Larry Roux
Syracuse University
lroux@syr.edu
*******************************
>>> chandrashekar_patlolla@yahoo.com 11/19/03 01:07PM >>>
Hi ALL
i have two variables
1. temp which is number(7,6)
2. temp1 which is number(7,6)
and when i am doing this
if temp - temp1 = 0
do xyz
end-if
but the control is not going to the procedure xyz. Is that SQR does not
recognize the 0's if yes how.
Thanks in advance
Regards
Chandra
"Sahani, Dev" <Dev.Sahani@fmr.com> wrote:
Thanks for replying.
The thing is that I have no control on the number of lines in the header, it is
controlled by user input. So it maybe the case that the header is actually
going beyond a whole page in some cases, causing this error...
I don't have a footer in the report, so looks like, that's not the reason I am
getting this error.
I'm quite convinced that my header is overflowing. I'll try and prototype this
with something simple to see if that's the case
Thanks,
Dév Rishi Sahani
FESCo DB Systems
Fidelity Investments
-----Original Message-----
From: D Patel [mailto:dgpinfo@yahoo.com]
Sent: Tuesday, November 18, 2003 10:15 PM
To: sqr-users@sqrug.org
Subject: Re: [sqr-users] BEFORE-PAGE, AFTER-PAGE procedures??
As per my observation this error will be generated
only when you are trying to write something in Footer
but you don't have enough-space in footer. So, it will
try to write footer on the next page and hence the
error get generated.
To avoid this erro try to increase Footer size.
Thanks,
D Patel
--- Jyotsna Nekkanti wrote:
> Hi,
>
> I got the same error a while back. And I think it
> has to do with either the number of lines in the
> header or the co-ordinates in the body of the
> report. Try decreasing them and see if that helps.
>
>
>
> "Sahani, Dev" wrote:
> Hey All,
>
> I have a couple of SQR jobs that run fine most of
> the times, but a few
> instances fail, and I get the following error in the
> Job factory Log:
>
> >>(SQR 5400) Second page write attempted while
> writing current page.
> >>Check BEFORE-PAGE, AFTER-PAGE procedures.
>
> Yeah the jobs are a little funky in the sense that
> the header that comes on
> the first page is dynamic, so I calculate the
> position of first line based
> on the number of lines used by the header
> dynamically... Something like
> this:
>
> Let #HeaderSpace = #HeaderSpace * 10 !Header Space
> is the number
> of lines taken up by the header (only on page one)
> Add 10 to #HeaderSpace !To make sure that
> the variable headerspace is > 0 for relative
> positioning
> !And if
> enough room on the page, printing will start 10
> points below the header
>
> If #HeaderSpace >= (#sqr-max-lines) !If the header
> takes up the
> entire page, start printing query results on page
> two
> New-Page
> Else
> Position (+#HeaderSpace ) !Else set print
> position at #HeaderSpace
> End-If
>
> Any clue of what might be happening here?
>
> Any help will be greatly appreciated.
>
> Thanks,
> Dev Rishi Sahani
> ________________
> FESCo DB Systems
> Fidelity Investments
>
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users
>
> ---------------------------------
> Do you Yahoo!?
> Protect your identity with Yahoo! Mail AddressGuard
>
> _______________________________________________
> sqr-users mailing list
> sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users
__________________________________
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
http://antispam.yahoo.com/whatsnewfree
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
---------------------------------
Do you Yahoo!?
Protect your identity with Yahoo! Mail AddressGuard
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users
_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users