Nested Functions - Another Solution
Maloney, Charlie
Charlie.Maloney@Cognos.com
Thu, 17 Jun 1999 18:45:32 -0400
Terry:
You may need to use a conditional define
if you want to start sticking commas in the number
when the number exceeds 99999.
And you may need to use leading zeros
when the number is less than one dollar
or less than 10 cents.
For those situations I've used the SIZE function
in conditional defines.
We run into this frequently when displaying
currency conversions or account balances
in info statements.
Typically we set up conditional defines
and reference them in the info statement.
Charlie Maloney
Technical Account Manager
Charlie.Maloney@cognos.com
PH: 781 313 2305
FX: 781 229 6426
-----Original Message-----
From: Terry Pickering [mailto:pickering@myself.com]
Sent: Thursday, June 17, 1999 6:29 PM
To: powerh-l@lists.swau.edu
Subject: Re: Nested Functions - Another Solution
Here is another way to accomplish the same thing. I found it in some other
code and was able to apply it here. It's a little less confusing. See the
difference between the two and decide what might work for you sometime.....
DEFINE X INT*8 = 12345
DEFINE Y CHAR*10 = LJ( RJ(ASCII(X)[1:10])[1:8] + "." + ASCII(X,10)[9:2])
DEFINE Z CHAR*10 = ASCII(FLOOR(X/100)) + "." + ASCII(MOD(X,100),2)
REPORT X Y Z
X Y Z
12345 123.45 123.45
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Terry Pickering Consultant Extraordinare
Monday and Friday Tuesday - Thursday
Portland Eugene
(503) 245-7178 (541) 687-3416
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ = = = = = = = = =
= = = = = = = = = = = = = = = = = = = = = = = = = = = = = 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.