Skip to main content

Non-unique dataname message on USAGE COMP field

  • February 15, 2013
  • 0 replies
  • 0 views

Problem:

Compiler appears to automatically redefine "usage comp" fields to comp-5.  When field is referenced receive non-unique data name error.  This occurs when using the Oracle preompiler PROCOB

Resolution:

By default pcbcfg.cfg (in $ORACLE_HOME/precomp/admin) defines:

comp5=yes

define=comp5

Changing COMP5=YES to be COMP5=NO will resolve this issue.

COMP5=YES can also be overridden at compile time by passeing COMP5=NO in the list of directives to be passed to the Pro*COBOL precompiler as follows:

PREPROCESS(COBSQL) CSQLT=ORACLE8 ENDC COMP5=NO P(CP) ENDP

The only effect this directive has is on the code generated by the Oracle precompiler.

As COMP and COMP-5 are the same byte ordering on AIX, the change should not impact the application. To see what I mean, with this small app :

        01 a pic s9(4) comp-5 value 23.

        01 b pic s9(4) comp value 23.

        procedure division.

        display "hi"

        .

viewing the values of A and B in hex on AIX shows:

                                                         *B***************

                                                         *2000CB7C: 00 17 [^^]*

                                                         **********************

                                                         *A***************

                                                         *2000CB74: 00 17 [^^]*

                                                         **********************

whereas on Linux x86 -- the reverse byte ordering -- the same view in animator shows:

                                                         *B***************

                                                         *080587E4: 00 17 [^^]*

                                                         **********************

                                                         *A***************

                                                         *080587DC: 17 00 [^^]*

                                                         **********************

Old KB# 2109

0 replies

Be the first to reply!