Link to home
Start Free TrialLog in
Avatar of black_spider_productions
black_spider_productions

asked on

Progress DB File

Hello,

I am supplied with a Progress 6.2 DB File, and I want to export the tables and their contents to a text file, how am I going to do this? As a first step, exporting the layout would be nice.

Regards,

Black Spider
Avatar of jrb1
jrb1
Flag of United States of America image

The basic solution for exporting a table:

OUTPUT TO file.txt.
FOR EACH customer:
EXPORT DELIMITER "~011" customer.
END.
OUTPUT CLOSE.

That's tab delimited.  Look for solution P4068 at http://esupport.progress.com/

Here's a custom program you might be able to use if the other option won't work:

http://www.smart-it-consulting.com/article.htm?node=89&page=8
Avatar of black_spider_productions
black_spider_productions

ASKER

Well, I tried that 'custom program' before and it doesn't work for Progress 6.2.

The problem with the basic solution is that I don't know the table names.

Regards,

Black Spider
Sure, I wasn't thinking about the version.  There is a table "_file" which contains the names of the tables, and "_field" for the fields.  Here's an example of extracting those to a file.

OUTPUT TO Table.file

/* _file-number > 0, excludes Virtual System Tables,
    _file-name BEGINS "SYS" excludes system tables from the listing */

    FOR EACH _file WHERE _file-number > 0 AND
                     NOT _file-name BEGINS "SYS":
      FOR EACH _field OF _file:
        DISPLAY _file._file-name _field._field-name.
      END.
  END.
OUTPUT CLOSE.
When running your code, I get the following error message :

Line 1 - Colons only allowed on header statements or labels (199)

I'm not very familiair with Progress syntaxes, so I am not able to fix it myself (because it's pretty urgent).
hmmm....how are you trying to run this?  From the docs:

The colon (:) symbol ends block labels and block header statements like DO, FOR, and REPEAT. It serves as a separator between a widget reference and an attribute or method, and between a character string literal and its attributes. It also follows the EDITING keyword in an EDITING phrase and is a device delimiter on Windows.

If you're running from Windows, run the prowin32 executable...on Unix:

 mpro [ db-name ] [ parameters ]

db-name
Specifies the database you want to start. If the database is not in the current directory, you must specify the full pathname of the database.

parameters
Specifies the startup parameters you want to use.
I run the _prowinw.exe executable, and then input your code or just put the code in a file and execute the file, that makes no difference.
hmmm....I haven't used that lately, but got the script straight from the Progress web-site.  I'll try a few things and post later.
I can't test right now..but one more try:

OUTPUT TO Table.file
    FOR EACH _file WHERE NOT _file-name BEGINS "SYS" AND _file-number > 0:
      FOR EACH _field OF _file:
        DISPLAY _file._file-name _field._field-name.
      END.
  END.
OUTPUT CLOSE.
I still get the same error.
Few suggestions:
- Aren't there 3rd-party programs which are able to read the Progress DB file format?
- Do ODBC drivers for Progress 6.x exist?

Regards,

Black Spider
here's another possible script I found:
========

output to stuff1.txt.
               
for each _file:
               
  /* print out the table class and name */
               
  if (0 < _file-num) then put "Table ".
  if (-6 <= _file-num) and (_file-num <= -1) then
      put "Metadata Table ".
  if (-29 <= _file-num) and (_file-num <= -7) then
      put "Fast Track Table ".
  if (-30 < _file-num) and (_file-num <= -16383) then
      put "Metadata Table ".
  if (-32767 <= _file-num) and (_file-num <= -16385) then
      put "Virtual System Table ".
   
  put _file-name skip.
               
  /* examine all the fields that make up a row
     in the table. This is an extremely short
     examination to illustrate the point. All we
     do is list the name of the field */
               
  for each _field of _file:
    put "  Field: " _field-name skip.
  end.
               
  /* add a blank line after each table's fields */
               
  put "" skip.
end.
output close.
 
I don't know of any 3rd party programs to read the files, but there are ODBCs available.  Here's one:

http://www.datadirect.com/knowledgebase/kbase.nsf/SupportLink+Online/33608?OpenDocument
When running your supplied code, i get the following error:

Unknown or ambiguous file _file (725)

That's an error on line 3.
I am now going to test that ODBC Driver.
I don't have a server running the Progress DB, how should I configure the ODBC?
ASKER CERTIFIED SOLUTION
Avatar of jrb1
jrb1
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'm getting this error:

Unknown or ambiguous file _db (725)
Could not understand line 6 (196)
very simple if you use hex editor, like hexedit.com.
all you need is see field names, any good hex editor show you field names, you write these down, and after each field name, the field length is in bytes, but in hex, so you need convert to decimal -- can find hex-dec converters on net.
When you know field names and field lengths, you should be able to import to any other data format.
Anyway, why cant you use the original DB program to open the file, then export to CSV or comma delimited ASCII?  Once you get that far, nothing impossible to convert.  Never have found database format that cant be converted, just need to do little bit of looking to find format.  start with hexeditor, go from there, simple once you figure out format.
"all you need is see field names"
> Well, I think I got some table names, how can I check them in Progress 6.2?

"Anyway, why cant you use the original DB program to open the file"
> What original DB program? Do u mean Progress 6.2?
> I have another Progress-program, but it isn't able to export.
[Update]
- I was able to retrieve all table names, by using a Hex Editor (much easier than notepad/wordpad because it skips all non-readable chars)
- I find the field names as well in the hex editor, but I cannot figure out which group of fields belong to which table.
- Now I am going to find a command to check which table is which (I mean, the table names don't say much), by dumping some rows.
I got a little further, but now I get the following error:
NETBIOS must be loaded and working before running PROGRESS.

when connecting to a database..
- Is there a way to export the tables using the _proutil.exe executable?
- ... or any of the other PROGRESS tools?

NB: Remember it's version 6.2

Thanks in advance,

Black Spider
The reason why i requested to close this question is because I want to re-ask this question without the PROGRESS part...

Regards,

Black Spider
I don't know why the procedures as delivered by Progress are not running...paq/refund is ok with me.
Today, the problem is solved by using the "PROGRESS Runtime NLM"...
I was able to export the whole database layout and what the data itself!

Thanks for your support, and I would like to give jrb1 100 points and get the rest refunded!

Regards,

Black Spider
It's allright, I just wondered... =)
Thanks already!