Operating System - HP-UX
1753500 Members
4407 Online
108794 Solutions
New Discussion

Procob 1.8 to Procob 8.1 on HP UX

 
Bruce White
Occasional Contributor

Procob 1.8 to Procob 8.1 on HP UX

We run COBOL programs with embedded sql, and are currently upgrading from Oracle version 7.3.4, with Pro Cobol release 1.8.4.0.0 to Oracle 8.1.7 with Pro Cobol 8.1.7.0.0.

Under the old version, host variables containing trailing spaces have these automatically trimmed if the field is used for update or comparison with a column on the database described as VARCHAR2. Under the new version, this does not appear to be the case.

e.g.
column_name varchar2(10)
01 hv-name pic x(10) value "abc".

update table
set column_name = :hv-name

Under the old version, this results in column_name being length(3) and containing 'abc'.

The same code under the new version results in column_name being length(10) and containing 'abc '.

Our best work-around so far is to change the embedded sql statement to:

update table
set column_name = rtrim(:hv-name)

This solution is not ideal, as the changes will be time consuming, and it will be necessary to search all programs for this type of code.

Is there an easier way (such as a parameter setting) which will achieve the same result?

Your help or any suggestions would be greatly appreciated.
1 REPLY 1
Bruce White
Occasional Contributor

Re: Procob 1.8 to Procob 8.1 on HP UX

Doh !!

Found the problem before we got a reply. The Oracle meta system gave us the answer. When converting from 1.8 to 8.1 of the procobol software you may need to specify PICX-VARCHAR2.
Looks like this will do the trick.