Re: INDEXES: BTRIEVE vs EXTFH (cobol)



If your Btrieve indices are strings, yet the data is Numeric, then the
Btrieve file structure is incorrect. You may need to contact
Microfocus to determine how to get the file definition to be created
properly at the Btrieve layer.

You *MAY* be able to make the repair yourself, but I do not know if
this will impact the MF operating environment or not. Luckily, a
simple PIC 9(3) field has a range of "000" through "999", so treating
it as a string works. However, if SQL looks at it as a signed value,
everything gets messed up. So, you MUST fix the problem to get good
queries from SQL.
Goldstar Software Inc.
Pervasive-based Products, Training & Services
Bill Bach
BillBach@xxxxxxxxxxxxxxxxxxxx
http://www.goldstarsoftware.com
*** Chicago: Pervasive Service & Support Class - 07/2006 ***


alexandretalbert@xxxxxxxxx wrote:

Hi folks!

I have some betrieve files created by Microfocus Cobol (trough
FILETYPE"6" directive), and accessed trough DDF files created with
"CREATE TABLE" statements. My (BIG) problem concern to the INDEXES.
With BUTIL -STAT, I can see that every index on the data file is
created eith type=String.

So, the DDF index definition will never match. For example, for the
table:

FD DC0030.
01 DC0030-REG.
2 DC0030-CODE PIC 9(3).
2 DC0030-NAME PIC X(50).

SELECT DC0030 ASSIGN TO WS0030-CAM-GERAL
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
LOCK MODE IS AUTOMATIC
FILE STATUS IS WS-8005-STATUS
RECORD KEY IS DC0030-CODE
.

I have the following CREATE TABLE:

CREATE TABLE DC0030 USING 'DC0030.MKD' (CODE NUMERIC(3,0), NAME
CHAR(50),PRIMARY KEY(CODE))

Then the PRIMARY INDEX CODE is NUMERIC on DDF but STRING on the data
file....For this reason, some queries doesn´t work.....

Any suggestion??

Thanks!!!!

.



Relevant Pages

  • Re: INDEXES: BTRIEVE vs EXTFH (cobol)
    ... In SQL, you can specify just about anything, but at the lower MKDE ... the engine has to pick the right Btrieve ... When COBOL needs to find this value, it knows that the key is a string. ...
    (comp.databases.btrieve)
  • Re: INDEXES: BTRIEVE vs EXTFH (cobol)
    ... Bill Bach wrote: ... In SQL, you can specify just about anything, but at the lower MKDE ... the engine has to pick the right Btrieve ... When COBOL needs to find this value, it knows that the key is a string. ...
    (comp.databases.btrieve)
  • Re: COBOL KEY SEGMENTS
    ... Can anyone tell me why COBOL creates every key segment (for indexed ... When the programa creates the file (btrieve), ... utility) that its index has ONE STRING SEGMENT instead NUMERIC ...
    (comp.lang.cobol)
  • Re: KLEIN the LIAR
    ... There is, however, a string "MicroFocus" in the FAQ posted on 07 Nov 2009, ... The relevant text is in (Q10) What tools are available?: ... MicroFocus offers tools to accompany PL/I for OS/2. ... Unsolicited bulk E-mail subject to legal action. ...
    (comp.lang.pl1)