Operating System - OpenVMS
1753826 Members
8796 Online
108805 Solutions
New Discussion юеВ

Re: using fortran and profor with upgraded VMS and Oracle

 
robert70
Valued Contributor

Re: using fortran and profor with upgraded VMS and Oracle

THANKS PATRICK
how do i check what the value is set to?
a wrapper? explain to me what this is please thanks

Re: using fortran and profor with upgraded VMS and Oracle

Robert

Enter one or all of

sh sym cxx
sh sym cc
sh sym for

and look for what the '/float' qualifier is set to.

When we moved to Itanium, we were unaware that support for non-IEEE FP types had been removed from Oracle10g. Indeed, Oracle themselves seemed to be unaware of it and we spent some time going round the buoy with Oracle support.

The problem we then had was that data originally running on VAX and then Alpha (but still relying on the D_FLOAT FP type) would not work on 10g.

It was decided that since

a) We handled considerable volumes of data across many sites
b) All our DB access was done through a wrapper layer

we would update our DB wrapper code to use the

CVT$CONVERT_FLOAT

function to perform the necessary floating-point conversion on the way in and out of the database.

I'm just flagging up that if your Oracle9i setup is using a non-IEEE format you wont be able to restore any of that data into an Oracle10g database. You would have to write something to perform the CVT$CONVERT_FLOAT operation onto your data as you write it into your new database.
robert70
Valued Contributor

Re: using fortran and profor with upgraded VMS and Oracle

interesting stuff Patrick
sounds like we might be in for a long upgrade process!!

would the problem expalin this compile error?

$@forcomp

parameter (min_real_16 = -0.841Q-4932)
................................^
%F90-E-ERROR, The value was either too large or too small when converting to a R
EAL(KIND=16) number, and overflow/underflow occurred. [0.841Q-4932]
at line number 74 in file DAVE$DKB1:[LIBRARY7]MACH_CONSTS.DEF;10


MACH_CONSTS.DEF is in the library7 directory that we use for all our fortran programs. The programmers that wrote the code have long left the company so not sure why that particular number .841 to the power -4932 is used
abrsvc
Respected Contributor

Re: using fortran and profor with upgraded VMS and Oracle

The value is the limit for a VAX H_Float number. I would check to see if the parameter is defined as REAL*16.

The range for an H_float (REA*L16) number is:
0.84*10**--4932 through 0.59*10**4932

Dan
robert70
Valued Contributor

Re: using fortran and profor with upgraded VMS and Oracle

thanks
understood
it has been defined as real*16
abrsvc
Respected Contributor

Re: using fortran and profor with upgraded VMS and Oracle

I forgot to include that the floating point format for IEEE standards is slightly different than for the VAX H_Float format. This means that the accuracy and ranges are different. Check the manuals for the limits for the floating point format you are using to adjust this parameter for that limit.

Dan
robert70
Valued Contributor

Re: using fortran and profor with upgraded VMS and Oracle

thanks DAN
so I would have to change my *.DEF file which currently shows

c reals

real*4 max_real_4
parameter (max_real_4 = 1.7E38)

real*4 min_real_4
parameter (min_real_4 = -0.30E38)


real*8 max_real_8
parameter (max_real_8 = 1.7D38)

real*8 min_real_8
parameter (min_real_8 = -0.30D38)

real*16 max_real_16
parameter (max_real_16 = 0.59Q4932)

real*16 min_real_16
parameter (min_real_16 = -0.841Q-4932)

Update this with the correct IEEE floating point values?

Not sure where to find these but I will have a look
abrsvc
Respected Contributor

Re: using fortran and profor with upgraded VMS and Oracle

It would appear so. I have those values documented, but not with me. I can update this later or maybe Hoff has these values readily available?

I'm not sure why the program would care specifically without seeing the code stream, but it appears that the limits are used somewhere in the code.

An examination of the code around the failure point might give us a clue:
CREATE_RIGHTS_ARRAY+1820
Can you post the code around the above point?
robert70
Valued Contributor

Re: using fortran and profor with upgraded VMS and Oracle

heres the subroutine..............


subroutine create_rights_array (v_mnem, start_date, end_date, rights, s├в ┬ж

include 'valuation.def'


character*7 v_mnem

integer*4 num

real*8 v_tshares(500),call_price (500)
real*8 stock_price
real*8 value, cost_value
real*8 cap_value

integer*4 seconds

character*3 valuation_curr

character*9 prev_date, or_time
character*16 add_time, jc_time

character*9 cap_date (500), start_date, end_date
character*7 s_mnem (500)
character*3 c_mnem (500)
c character*3 v_curr (10)

real*8 exchange_rate_2

integer*2 status,
> date_count,
> count

record / rights_record / rights
├в
seconds = -1 * seconds_in_day

value = 0.0
cost_value = 0.0


call get_v_folio_rights (v_mnem,
> start_date,
> end_date,
> s_mnem,
> v_tshares,
> call_price,
> cap_date,
> c_mnem,
> num,
> status)

if (status) then

if (num .ge. 1) then

date_count = 1
count = 1
rights.cap_date(date_count) = cap_date (count)
rights.value(date_count) = 0.0
rights.cap_value(date_count) = 0.0

do while (count .le. num)

if (cap_date(count) .ne.
> rights.cap_date(date_count)) then

date_count = date_count + 1
rights.cap_date(date_count) = cap_date(count)
rights.value(date_count) = 0.0

endif


prev_date = or_time (add_time
> (jc_time(cap_date(count)), seconds))

value = call_price(count) * v_tshares(count) *
> exchange_rate_2 (valuation_curr(v_mnem, prev_date),
> c_mnem(count),
> prev_date)

cost_value = call_price(count) * v_tshares(count) *
> exchange_rate_2 (valuation_curr(v_mnem, cap_date(count)),
> c_mnem(count),
> cap_date(count))

cap_value = stock_price(s_mnem(count), cap_date(count)) *
> v_tshares(count) *
> exchange_rate_2 (valuation_curr(v_mnem, cap_date(count)),
> c_mnem(count),
> cap_date(count) )

rights.value(date_count) = rights.value(date_count) +
> value

rights.cap_value(date_count) =
> rights.cap_value(date_count) +
> cap_value

rights.cost_value(date_count) =
> rights.cost_value(date_count) +
> cost_value

count = count + 1

enddo

rights.number = date_count

endif
endif

return
end
Mike Kier
Valued Contributor

Re: using fortran and profor with upgraded VMS and Oracle

Fortran 95 provides the HUGE and TINY intrinsic functions (*) to return the largest and smallest positive values representable for a given data type (KIND) and is the preferred mechanism since it is defined in the standard and is more portable between physical hardware types and underlying data representations.

The model does not assume a twos-complement implementation so the negative values are not provided.

Example:

HUGE and TINY for a REAL*16 KIND on Alpha with /FLOAT=IEEE_FLOAT returns

HUGE 1.189731495357231765085759326628007E+4932
TINY 3.362103143112093506262677817321753E-4932

(* - along with DIGITS, EPSILON, MAXEXPONENT, MINEXPONENT, PRECISION, RADIX, and RANGE for all numeric KINDS as well as EXPONENT, FRACTION, NEAREST, RESPACING, SCALE, SET_EXPONENT, and SPACING for REAL KINDS - see HELP FORTRAN INTRINSICS)

Practice Random Acts of VMS Marketing