Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask

blaise and perl

by aufrank (Pilgrim)
on Jul 02, 2002 at 21:01 UTC ( #179000=perlquestion: print w/replies, xml ) Need Help??

aufrank has asked for the wisdom of the Perl Monks concerning the following question:

hello all--
Just recently started to delve into the resources here, couldn't be more impressed. I'm curious if anyone out there has experience with an application called Blaise, developed by Statistics Netherlands and distributed by <a href=""Westat". We use it to develop Computer Aided Personal Interviews (CAPIs) for use in Genetic Epi studies.

This program, Blaise, allows you to quickly set up blocks of code that then appear as questions and fields on a gui which you follow through the interview. The application is great for gathering data, as its extremely easy to whip up a nice looking survey, but it's proven to be a beast to get the data out once Blaise has a hold of it.

As you go through Blaise's Data Entry Program (the gui to the script you wrote), information gets dumped to some propietary files, most notably *.bdb, where * is the name of the data model you were working with. This file is not just a simple text file, but rather can only be viewed through an internal viewer program.

It is possible to export data from a .bdb file, but it is a big pain. Blaise includes support for "Manipula", which are basically translation guides that explicitly tell Blaise how to translate each block of the original script into text. The scripts we use are hugely involved and contain many many different branches and modules, and so the prospect of writing Manipula for each of these elements could not be less appealing.

I would like nothing better than to be able to interface directly with the *.bdb files through perl, but am not sure if this is a reasonable pursuit. It has occurred to me that perhaps I would be best served trying to write a DBD for the DBI. My questions to you are:

a) is there anyone else who uses or has used Blaise? If so, how do you extract data from the proprietary files once it is gathered? Has perl been a part of your solution? and

b) what sorts of methods are likely to be successful in trying to get non-plaintext data out of a file, given the knowledge that hidden somewhere within is what looks very much like an RDB? and

c) if I were to attempt to create a DBD, what sort of knowledge of the file format would I need to gather, and how viable is a pureperl solution as opposed to a DBD written in C?

I plan on making similar postings to comp.lang.perl.misc and perl.dbi.users within the next day or two, unless any of you think that is unwise.

thanks in advance for any advice, especially regarding other places to direct my queries

Replies are listed 'Best First'.
Re: blaise and perl
by hossman (Prior) on Jul 03, 2002 at 00:00 UTC
    I'd never heard of Blaise untill I read your post, and It got me curious, so...

    I found the Blaise User Group which had a Hints & Tips page, which linked to this promising URL: Extraction of whole Blaise files to SAS ...

    The Blaise software set includes a Cameleon program (SAS.CIF) which can be used to extract data and load it into SAS. It generates a Manipula program that copies the Blaise file to ASCII and then generates a SAS program which can be used to read the ASCII file into SAS.

    Sounds like you could use this to get an ASCII dump of your data, whch would be in a format a lot easier to reverse engineer then an unknown binary format.

Re: blaise and perl
by Aristotle (Chancellor) on Jul 02, 2002 at 23:15 UTC

    The key question here, I believe, is what you forsee to be done with the data. Since you're not interfacing with the application but rather reading the files yourself, a DBD "driver" in your case would have to be a fullblown database engine, complete with SQL parser and all the dirty nitty gritty. Is such heavy duty data munging and close integration with Blaise forseeable that it makes that kind of effort worthwhile? I tend to think not so..

    It would probably be better to write some Perl code to merely im- and export for these .bdb files, and dump the data in and out of a "real" database for your munging needs.

    As far as reading non-textual data is concerned, Perl's unpack function is lots of very powerful magic and would fit your bill perfectly.

    Makeshifts last the longest.

      thanks again for the advice on unpack. unfortunately, I can't say I fully grok the documentation-- having a hard time figuring out how the templates described in pack would work in unpack. I can tell you that when I open the *.bdb file in emacs, I get lots of odd meta characters, with the data embedded within them. any guesses on what sorts of templates I should experiment with? thanks again,


        unpack produces a list of scalars corresponding to the template. I don't know how else to help you, since your description of the data is, well, "vague" would be an euphemism. :)

        Try looking at the file with hexdump, hexdump -c, strings and the various other tools for examining raw binary data.

        Makeshifts last the longest.

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://179000]
Approved by cjf
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others musing on the Monastery: (9)
As of 2022-12-01 15:49 GMT
Find Nodes?
    Voting Booth?