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/
RE: [U2] EVAL formatting
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.332,333.333 1,198.00 3.993,993.333 39,933.333 60.00 0.20 2.002,000.000 974.08 3.253,246.933 32,469.333 3,584.001,194.667 11,946.667 119,466.667 50.00 0.17 1.671,666.667 85.00 0.28 2.832,833.333 20.00 0.07 0.67 6.67 1,239.00 4.134,130.000 41,300.000 529.12 1.761,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/
RE: [U2] EVAL formatting
Thanks for all your help. I'm making some head way on my EVAL formatting looks like OCONV or ICONV is going to do the trick. To those that think I should write an I-desc, I would, the problem is that I can't. I don't have the privileges. I'm an end user trying my best at using the tools presented to me. Plus my data needs vary so much I don't want to clutter up the dictionaries with a zillion odd I-desc that I would have to ask our overly taxed IT department to create. To RayW or anyone else who knows: Tell me more about this AS function in relation to EVAL. I couldn't find it in the Uniquery or Unibasic help. Anything would be helpful. Still learning, Kevin At 08:30 AM 8/18/2004 +1000, you wrote: I can't tell you exactly where it is in the manual, but you can use the same field modifiers (TOTAL, CALC, BREAK.ON, etc.) and field qualifiers (FMT, CONV, COL.HDG, AS, etc.) with EVAL as you can with named fields. Field qualifiers, in particular, override dictionary specifications for named fields, or supply them for EVAL expressions. AS gives the EVAL expression a field name that can be used elsewhere in the sentence. CONV specifies a conversion specification. COL.HDG specifies a column heading. Multi-line with 'L', e.g. COL.HDG Post'L'Code FMT specifies a formatting specification. SINGLE.VALUE specifies that the field will be treated as single-valued. MULTI.VALUE specifies that the field will be treated as multi-valued. ASSOC places the (multi-valued) field into an existing association. ASSOC.WITH places the (multi-valued) field into a temporary association with another multi-valued field. --- 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/
RE: [U2] EVAL formatting
I can't tell you exactly where it is in the manual, but you can use the same field modifiers (TOTAL, CALC, BREAK.ON, etc.) and field qualifiers (FMT, CONV, COL.HDG, AS, etc.) with EVAL as you can with named fields. Field qualifiers, in particular, override dictionary specifications for named fields, or supply them for EVAL expressions. AS gives the EVAL expression a field name that can be used elsewhere in the sentence. CONV specifies a conversion specification. COL.HDG specifies a column heading. Multi-line with 'L', e.g. COL.HDG Post'L'Code FMT specifies a formatting specification. SINGLE.VALUE specifies that the field will be treated as single-valued. MULTI.VALUE specifies that the field will be treated as multi-valued. ASSOC places the (multi-valued) field into an existing association. ASSOC.WITH places the (multi-valued) field into a temporary association with another multi-valued field. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
Unclassified RE: [U2] EVAL formatting
Kevin, How about LIST CS.2004 H.HCG.AWARDED.ALL H.TOTAL.AWARD EVAL OCONV((H.HCG.AWARDED.ALL/H.TOTAL.AWARD*10), 'MD1') There's probably a way to do it with EVAL ... FMTsomething cryptic, too HTH Mike -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Michaelsen Sent: Tuesday, 17 August 2004 09:02 To: [EMAIL PROTECTED] Subject: [U2] EVAL formatting I had one of my IT folks look at this one and I don't want to belive them. They said you cannot display a decimal when using the EVAL command. I think there is got to be a way. That's why I put this out. The current EVAL statement displays 1 or 0. Any ideas?? LIST CS.2004 H.HCG.AWARDED.ALL H.TOTAL.AWARD EVAL H.HCG.AWARDED.ALL/H.TOTAL.AWARD kevin The information contained in this Internet Email message is intended for the addressee only and may contain privileged information, but not necessarily the official views or opinions of the New Zealand Defence Force. If you are not the intended recipient you must not use, disclose, copy or distribute this message or the information in it. If you have received this message in error, please Email or telephone the sender immediately. --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] EVAL formatting
Of course you can display a decimal. Try this: LIST CS.2004 H.HCG.AWARDED.ALL H.TOTAL.AWARD EVAL (H.HCG.AWARDED.ALL * 100)/H.TOTAL.AWARD) CONV MR2 Richard B. Lewis Sr. Software Engineer Dynix r-l-e-w-i-s-at-d-y-n-i-x-dot-c-o-m p 801-223-5392 f 801-223-5202 www.dynix.com -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Michaelsen Sent: Monday, August 16, 2004 3:02 PM To: [EMAIL PROTECTED] Subject: [U2] EVAL formatting I had one of my IT folks look at this one and I don't want to belive them. They said you cannot display a decimal when using the EVAL command. I think there is got to be a way. That's why I put this out. The current EVAL statement displays 1 or 0. Any ideas?? LIST CS.2004 H.HCG.AWARDED.ALL H.TOTAL.AWARD EVAL H.HCG.AWARDED.ALL/H.TOTAL.AWARD kevin --- 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/
RE: [U2] EVAL formatting
-Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Kevin Michaelsen Sent: Monday, August 16, 2004 3:02 PM To: [EMAIL PROTECTED] Subject: [U2] EVAL formatting I had one of my IT folks look at this one and I don't want to belive them. They said you cannot display a decimal when using the EVAL command. I think there is got to be a way. That's why I put this out. The current EVAL statement displays 1 or 0. Any ideas?? LIST CS.2004 H.HCG.AWARDED.ALL H.TOTAL.AWARD EVAL H.HCG.AWARDED.ALL/H.TOTAL.AWARD - Could you not wrap an OCONV around this? LIST CS.2004 H.HCG.AWARDED.ALL H.TOTAL.AWARD EVAL OCONV(H.HCG.AWARDED.ALL/H.TOTAL.AWARD,'MR20') As to the 0 or 1, what are the range of values in H.HCG.AWARDED.ALL vs. H.TOTAL.AWARD? --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/
RE: [U2] EVAL formatting
Kevin, Tried this on my UV system, and it works just fine: LIST INVOICE 16 17 WITH 16 0.00 AND WITH 17 16 EVAL (@RECORD16 / @RECORD17) * 1 CONV MD2 FMT 14R COL.HDG Tax % of Gross 05:28:17pm 16 Aug 2004 PAGE1 INVOICE... Tax Amount Net Invoice... Tax % of Gross 394407 30.19 555.19 5.44 788813 5.17 91.35 5.66 788814 7.33 101.85 7.20 788815 5.82 80.88 7.20 The values stored in attributes 16 and 17 are scalar integers with virtual decimals, so had to do the * 1 to make the decimals come out right --Ron P. -Original Message- From: Kevin Michaelsen [mailto:[EMAIL PROTECTED] Sent: Monday, August 16, 2004 4:02 PM To: [EMAIL PROTECTED] Subject: [U2] EVAL formatting I had one of my IT folks look at this one and I don't want to belive them. They said you cannot display a decimal when using the EVAL command. I think there is got to be a way. That's why I put this out. The current EVAL statement displays 1 or 0. Any ideas?? LIST CS.2004 H.HCG.AWARDED.ALL H.TOTAL.AWARD EVAL H.HCG.AWARDED.ALL/H.TOTAL.AWARD kevin --- 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/
RE: [U2] EVAL formatting
The help on this statement shows zilch. The syntax is EVAL EXPRESSION, so unless there's undocumented features then I doubt it. from the retrieve.pdf UV10 manuals pp 3-33 Some Ways to Use CONV ...Sometimes the results of an EVAL expression need a CONV specification to cause the appropriate number of significant digits to be displayed... ** This email message and any files transmitted with it are confidential and intended solely for the use of addressed recipient(s). If you have received this email in error please notify the Spotless IS Support Centre (61 3 9269 7555) immediately who will advise further action. This footnote also confirms that this email message has been scanned for the presence of computer viruses. ** --- u2-users mailing list [EMAIL PROTECTED] To unsubscribe please visit http://listserver.u2ug.org/