Skip to main content

Hi I'm doing migration from Server Express 5.1 to Visual Cobol 7.0
the current Server Expression 5.1 is running on Redhat Linux 6, with some SQLs compiled Oracle 12c
and the new Visual Cobol 7.0 is running on Redhat Linux 8, with some SQLs compiled Oracle 19c
Now I'm comparing the results between current result and new.
Here's the issue. there's a data [39.5] in the Oracle, It's [NUMBER(7,3)]
and In the COBOL, It's like
EXEC SQL
DECLARE CURAD0011 CURSOR FOR
SELECT cc1 FROM TT1; --->(this cc1 is [39.5] defined by [NUMBER(7,3)])
OPEN CURAD0011
FETCH CURAD0011
INTO : VAR1
END-EXEC
This [VAR1] is defined by [PIC S9(4)V9(3) COMP-3]
Here's the problem:
as the result of Server Express, VAR1 set from [39.5] to [40]
but the result of Visual Cobol, VAR1 set from [39.5] to [39.5] ( not changed )
Could you please help me to solve this ?
I don't know whether is a Compatibility Issue or
I have to add any compile command while compiling SQL (I'm using Pro*COBOL Preprocessor)
Thanks

Hi I'm doing migration from Server Express 5.1 to Visual Cobol 7.0
the current Server Expression 5.1 is running on Redhat Linux 6, with some SQLs compiled Oracle 12c
and the new Visual Cobol 7.0 is running on Redhat Linux 8, with some SQLs compiled Oracle 19c
Now I'm comparing the results between current result and new.
Here's the issue. there's a data [39.5] in the Oracle, It's [NUMBER(7,3)]
and In the COBOL, It's like
EXEC SQL
DECLARE CURAD0011 CURSOR FOR
SELECT cc1 FROM TT1; --->(this cc1 is [39.5] defined by [NUMBER(7,3)])
OPEN CURAD0011
FETCH CURAD0011
INTO : VAR1
END-EXEC
This [VAR1] is defined by [PIC S9(4)V9(3) COMP-3]
Here's the problem:
as the result of Server Express, VAR1 set from [39.5] to [40]
but the result of Visual Cobol, VAR1 set from [39.5] to [39.5] ( not changed )
Could you please help me to solve this ?
I don't know whether is a Compatibility Issue or
I have to add any compile command while compiling SQL (I'm using Pro*COBOL Preprocessor)
Thanks

my experience is that there are no problem by migration from Netexpress 5.1 to Visual Cobol 7 or 8 on sql statements.
Which database you use?
can you post the create statement of this table? This is necessary to test your program or sql-statement and find the problem.

or post a smal cbl program with only the variables for this and this sql statement!

What is the sql error number and error text?


Hi I'm doing migration from Server Express 5.1 to Visual Cobol 7.0
the current Server Expression 5.1 is running on Redhat Linux 6, with some SQLs compiled Oracle 12c
and the new Visual Cobol 7.0 is running on Redhat Linux 8, with some SQLs compiled Oracle 19c
Now I'm comparing the results between current result and new.
Here's the issue. there's a data [39.5] in the Oracle, It's [NUMBER(7,3)]
and In the COBOL, It's like
EXEC SQL
DECLARE CURAD0011 CURSOR FOR
SELECT cc1 FROM TT1; --->(this cc1 is [39.5] defined by [NUMBER(7,3)])
OPEN CURAD0011
FETCH CURAD0011
INTO : VAR1
END-EXEC
This [VAR1] is defined by [PIC S9(4)V9(3) COMP-3]
Here's the problem:
as the result of Server Express, VAR1 set from [39.5] to [40]
but the result of Visual Cobol, VAR1 set from [39.5] to [39.5] ( not changed )
Could you please help me to solve this ?
I don't know whether is a Compatibility Issue or
I have to add any compile command while compiling SQL (I'm using Pro*COBOL Preprocessor)
Thanks

Pro*COBOL is an Oracle product and not a Micro Focus one. Have you asked Oracle about this difference in behavior?

It is my understanding that a NUMBER(7,3) column with a value of 39.5 should not be rounded. I am not sure how you got the rounding to occur in the older products. Are you using the same Pro*COBOL configuration file?

The only way I know of to get this to round is to use the ROUND function on the column:

SELECT ROUND(cc1) FROM TT1

Perhaps somebody else has run across this before and will comment here?