The suggestion by Karjala did work, but only if a field with the desired
conversion already exists. In the file I chose for a test sample there
were no fields with different conversions, so I had to create a new
field to continue the test. Which was the same work as creating a
virtual field in the first place. Except that I learned something.
There must be some difference between Universe and UniData on EVAL.
The original field has a conversion of "MD2," so my tests need to be
some other value to be a real test, so I used MD13 instead of MD12.
LIST AR.PAYMENT.ITEMS ARPI.AMT EVAL "OCONV(ARPI.AMT*100/3, 'MD13')" CONV
"" FMT "10R"
------------------------------------------------------------------------
-------^ syntax error
It appears that UniData does not allow a FMT after the CONV, and when
tested without FMT there was no output.
LIST AR.PAYMENT.ITEMS ARPI.AMT EVAL "OCONV(ARPI.AMT*100/3, 'MD13')" CONV
""
OCONV(ARPI.A
MT*100/3, 'M
AR.PAYMENT.ITEMS Amount...... D13')....... CONV
No records listed.
My last test was to retry running a straight EVAL/OCONV with very
inconsistent results.
LIST AR.PAYMENT.ITEMS ID.SUPP ARPI.AMT EVAL "OCONV(ARPI.AMT/3,'MD32,')"
EVAL "OCONV(ARPI.AMT*10/3,'MD32,')" EVAL "OCONV(ARPI.AMT*100/3,'MD32,')"
OCONV(ARPI.A OCONV(ARPI.A OCONV(ARPI.A
MT/3, 'MD32, MT*10/3,'MD3 MT*100/3, 'M
Amount...... ').......... 2,')........ D32,')......
70.00 0.23 2.33 2,333.333
1,198.00 3.99 3,993.333 39,933.333
60.00 0.20 2.00 2,000.000
974.08 3.25 3,246.933 32,469.333
3,584.00 1,194.667 11,946.667 119,466.667
50.00 0.17 1.67 1,666.667
85.00 0.28 2.83 2,833.333
20.00 0.07 0.67 6.67
1,239.00 4.13 4,130.000 41,300.000
529.12 1.76 1,763.733 17,637.333
20.00 0.07 0.67 6.67
David Morelli, UIS/Datatel Team
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Karjala Koponen
Sent: Friday, August 20, 2004 10:00 AM
To: [EMAIL PROTECTED]
Subject: RE: [U2] EVAL formatting
I run on UniData 5.2. I have used the first field conversion and
formatting feature of EVAL by inserting a field that has the conversion
and formatting I want as the first 'phrase' (stuff to first semi colon)
of an EVAL statement as in
... EVAL "FIELD.WITH.CONV.FMT.DESIRED;<eval I want that doesn't
reference @1>"...
though I often have FMT "xxx" and COL.HDG "yyy" phrases after the EVAL.
Karjala
>>> [EMAIL PROTECTED] 08/20/2004 5:51:59 AM >>>
Hallo David,
if you use field-names in your EVAL-expression, EVAL will apply the
conversion, format and single-/multivalue-attribute of the first field
you mention in your expression for the result. You can overwrite this
using then CONV-, FTM-, SINGLE.VALUE- and MULTI.VALUE-keywords. So try
for example:
... EVAL "OCONV(ARPI.AMT*100/3, 'MD12')" CONV "" FMT "10R" ...
and it will do what you expect. (The above is for UniVerse, but I hope
it will be similar for UniData.)
Regards
Thomas
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] Behalf Of Morelli, David
Sent: Thursday, August 19, 2004 7:29 PM
To: [EMAIL PROTECTED]
Subject: RE: [U2] EVAL formatting
>I am in Unidata and I have been following this and ran into a confusing
>result when trying to apply the EVAL/OCONV to a field that has an
>"MD2," format in DICT. Is there an easy way to clear the existing
>format so that the EVAL/OCONV format will process as intended?
____________
Virus checked by G DATA AntiVirusKit
Version: AVK 14.0.1842 from 13.08.2004
--
This message has been scanned for viruses and
dangerous content by MailScanner, and is
believed to be clean.
Mailscanner thanks transtec Computers for their support.
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/
-------
u2-users mailing list
[EMAIL PROTECTED]
To unsubscribe please visit http://listserver.u2ug.org/