running cobol applications accessing oracle tables

in acucobol

Primary Key prhead-key 9(10)  

move 0 to prhead-key 

start file not < prhead-key 

works when accessing vision file translates 0 to 0000000000 (I believe)

and finds all records

 

 

Oracle Table  

move 0 to prhead-key   returns a status = 23  because it interprets key as 0sssssssss where s = a space

Also empty 'temporary' files return a '92' error when read

 

Is there a configuration variable to handle these little quirks? 

 

Thank you

  • I'm wondering if in the xfd it is treating prhead-key as alpha-numeric as group level which is the default for group-level. So in other words, it may be looking at it as PIC X(10) rather than PIC 9(10). Check the oracle table first make sure it is numeric, then you may have to add a specific xfd definition for the group level. You can do this without creating a conversion program simply by using a redefines instead. However, you'll have to check the xfd and you may need to add and xfd definition for that field.
  • I don't see this behavior with my test program. It may have something to do with your XFD. Please attach your test program, the XFD file, and configuration file.
  • I do not know if it can solve your problem but I have solved sorting problems between mixed numeric data and not
    with the following command

    CALL "SQL" USING "ALTER SESSION SET NLS_SORT=BINARY"

    This is the defination of NLS_SORT in Oracle

    NLS_SORT specifies the collating sequence for ORDER BY queries.

    If the value is BINARY, then the collating sequence for ORDER BY queries is based on the numeric value of characters
    (a binary sort that requires less system overhead).