Jump to content


Photo
- - - - -

Reading C-ISAM without data dictionary


7 replies to this topic

#1 Surajit

Surajit

    Expert

  • Members
  • PipPipPipPip
  • 132 posts
  • Gender:Male
  • Location:Land of Smiles :-)

Posted 23 February 2004 - 03:06 AM

Hello all,

My customer has an application using C-ISAM as its data file but no source code and the owner of the application has already gone out from business :p.

Is it possible to get data from C-ISAM file on AIX without its file's definition ? I have searched from old topics and found that the .dat file is just flat file. If I read the .dat file like sequencial file then can I using substring to extract data from it ?

Thanks,

Surajit

#2 Mike Wright

Mike Wright

    Advanced

  • Members
  • PipPipPip
  • 88 posts
  • Gender:Male
  • Location:Birmingham, United Kingdom
  • Interests:I dance for money.

Posted 23 February 2004 - 07:48 AM

We use a U/SQL Adapter from transoft.com to extract data from CISAM files.

You will need to guess the lengths of the variables and map the file first to get it to work correctly, but that shouldn't be too much of a problem.

Check out their website for more info. It's under Products - Intelligent Adapters.
Magicians disappear all the time, but as soon as a regular person does it, everyone is all scared.

#3 Surajit

Surajit

    Expert

  • Members
  • PipPipPipPip
  • 132 posts
  • Gender:Male
  • Location:Land of Smiles :-)

Posted 23 February 2004 - 10:02 AM

Hi,

I copied file from AIX to PC and use Hexadecimal Editor to see the data. I can read the alphanumeric field but with the field which is numeric, I don't know what format that it used.

Thanks for your suggest, I will try it.

Surajit

#4 Cleve Haynes

Cleve Haynes

    Expert

  • Members
  • PipPipPipPip
  • 172 posts
  • Gender:Male

Posted 23 February 2004 - 11:52 AM

Hi

Is this a ProIV application?

In C-ISAM files, numeric fields are generally stored in some kind of BCD (binary coded decimal). One numeric type that ProIV uses with C-ISAM is "COMP3".

There are previous posts on this forum on how to decode a COMP3 field, such as:
http://www.proivrc.c...&t=833&hl=COMP3

If the application is not ProIV, the numeric fields may be stored in another format. C-ISAM has a decimal type built in. The C-ISAM manual is available from IBM at:
http://www-306.ibm.c...ry/cisam_7.html
Or the Version 5 one:
http://www-306.ibm.c...ry/cisam_5.html

Cleve

#5 Guest_Guest_Richard Bassett_*

Guest_Guest_Richard Bassett_*
  • Guests

Posted 23 February 2004 - 05:15 PM

If the data's not from a ProIV App then, as I think Cleve was highlighting, you should note ProIV has never supported the C-ISAM decimal type (as far as I know anyway). So if you want to process the data in ProIV and some of it is in fact C-ISAM decimal numbers that could be pretty tricky..

If you're just migrating data rather than trying to interoperate with the old application you might consider writing a "one off" C program - if there's a C programmer handy.

If you know actual values for a subset of records, you can usually use the od (dump) command to look at raw C-ISAM .dat files and have a pretty good guess as to what's going on.

Note that in the (fairly rare) case variable-length C-ISAM is in use, not all the data is in the .dat files - some of it is floating around in the .idx files.

#6 Richard Bassett

Richard Bassett

    ProIV Guru

  • Members
  • PipPipPipPipPip
  • 696 posts
  • Location:Rural France

Posted 23 February 2004 - 05:19 PM

I'm sorry, the first part of the above was complete rubbish.
ProIV supports the C-ISAM decimal type as external type C-DEC.
Obviously my brain doesn't work if I forget to login..
Nothing's as simple as you think

#7 Mike Wright

Mike Wright

    Advanced

  • Members
  • PipPipPip
  • 88 posts
  • Gender:Male
  • Location:Birmingham, United Kingdom
  • Interests:I dance for money.

Posted 24 February 2004 - 07:54 AM

The transoft driver maps CISAM numerics as Binary Coded Decimals (BCD) and I use the format jd_31Dec1799 for dates, which represents a Julian Date since 31 Dec 1799. I remember trying for ages to get the right date format, and this was the only one (out of about a hundred different data formats) that would work.

Hope this helps
Magicians disappear all the time, but as soon as a regular person does it, everyone is all scared.

#8 Surajit

Surajit

    Expert

  • Members
  • PipPipPipPip
  • 132 posts
  • Gender:Male
  • Location:Land of Smiles :-)

Posted 25 February 2004 - 02:06 AM

Wow ! :-)

There is an U/SQL adapter to extract data to windows' application but it doesn't have data dictionary for all files and also may be it contains the different version of data dictionary. So I try to find out what I can get the most from .ufd file.

Thank you very much for all of your suggestions.

Cheers,
Surajit



Reply to this topic



  


0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users