Thanks, Mike! That helps a lot!!
Original Message:
Sent: 5/8/2023 2:07:00 PM
From: Mike Rajkowski
Subject: RE: UniVerse performance question - OCONV vs. mathematical division
Brian,
Both are very fast, fractional milliseconds, and while the div is faster I feel the OCONV handles invalid data better than the mathematical expression .
OCONV will not produce a runtime error if the data is non-numeric, and returns the value passed in, where the invalid DIV returns zero
i.e.
CRT OCONV("MIKE", "MD2")
produces
MIKE
Where:
CRT "MIKE" / 100
produces
Program "yourprogramname": Line 18, Nonnumeric data when numeric required. Zero used.
0
So, it also depends where you plan on using it, and how you would want to deal with non-numeric data.
Note that both methods will set the status, so you can check if there were issues after the fact with STATUS() if this is being done in your basic program.
------------------------------
Mike Rajkowski
MultiValue Product Evangelist
Rocket Internal - All Brands
DENVER CO US
------------------------------
Original Message:
Sent: 05-08-2023 12:33
From: Brian Paige
Subject: UniVerse performance question - OCONV vs. mathematical division
Greetings, all!
I used to know this answer, but I haven't worried about it in so long I can't remember.
Our data is masked with extra decimal positions. For example, 1.35 may be masked with 2 decimal places and stored as 135. When using this data for output, which is better performance-wise - OCONV or dividing by 100?
Thank you!
------------------------------
Brian Paige
------------------------------