Simpler Navigation for Servers and Operating Systems - Please Update Your Bookmarks
Completed: a much simpler Servers and Operating Systems section of the Community. We combined many of the older boards, so you won't have to click through so many levels to get at the information you need. Check the consolidated boards here as many sub-forums are now single boards.
If you have bookmarked forums or discussion boards in Servers and Operating Systems, we suggest you check and update them as needed.
Showing results for 
Search instead for 
Did you mean: 

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 to Oracle 8.1.7 with Pro Cobol

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.

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.
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.