title: Retrieve data from Pervasive database used by Magic application
body: <p>I have a client who has had a developer (who has died since) set him up a Magic eDeveloper application which uses a Pervasive V8 database. Thing is that his licence ran out and the developer is not around.</p>
  
  <p>There are no DDF files in the directory containing the .DAT files. However I have found a file called DDFA which contains text about potential DDF files. I don't know the format of DDF files, of the DDFA file and if one actually creates the other.</p>
  
  <p>Here are contents of the DDFA file:</p>
  
  <pre><code>VRSN=700
  
  Application=Yes
  FILE={NAME="file.ddf",DESC="file.ddf",ACCKEY="..SC....",DBNAME="Default Database",ENCR=N,RESIDENT=78,
  FLD={DESC="file id",PIC="2",STRG=5,ATTR=N,SIZ=2,WHLE=2,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="file name",PIC="20",STRG=1,ATTR=A,SIZ=20,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="file loc",PIC="64",STRG=1,ATTR=A,SIZ=64,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="flags",PIC="3",STRG=5,ATTR=N,SIZ=1,WHLE=3,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="filler",PIC="10",STRG=1,ATTR=A,SIZ=10,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  KEY={DESC="key 1(id)",MOD=S,DIR=T,RNG=Q,KEY_TYPE=R,
  SEG={SIZ=2,FLD=1,DIR=A}},
  KEY={DESC="key 2(name)",MOD=S,DIR=T,RNG=Q,KEY_TYPE=R,
  SEG={SIZ=20,FLD=2,DIR=A}}}
  FILE={NAME="field.ddf",DESC="field.ddf",ACCKEY="..SC....",DBNAME="Default Database",ENCR=N,RESIDENT=78,
  FLD={DESC="field id",PIC="3",STRG=5,ATTR=N,SIZ=2,WHLE=3,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="file id",PIC="3",STRG=5,ATTR=N,SIZ=2,WHLE=3,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="field name",PIC="20",STRG=1,ATTR=A,SIZ=20,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="bt data type",PIC="3",STRG=5,ATTR=N,SIZ=1,WHLE=3,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="offset",PIC="5",STRG=5,ATTR=N,SIZ=2,WHLE=5,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="size",PIC="5",STRG=4,ATTR=N,SIZ=2,WHLE=5,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="decimals",PIC="3",STRG=5,ATTR=N,SIZ=1,WHLE=3,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="flags",PIC="3",STRG=4,ATTR=N,SIZ=2,WHLE=3,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  KEY={DESC="key 1(field id)",MOD=S,DIR=T,RNG=Q,KEY_TYPE=R,
  SEG={SIZ=2,FLD=1,DIR=A}},
  KEY={DESC="key 2(file id)",MOD=N,DIR=T,RNG=Q,KEY_TYPE=R,
  SEG={SIZ=2,FLD=2,DIR=A}},
  KEY={DESC="key 3(field name)",MOD=N,DIR=T,RNG=Q,KEY_TYPE=R,
  SEG={SIZ=20,FLD=3,DIR=A}},
  KEY={DESC="key 4(file id+field",MOD=S,DIR=T,RNG=Q,KEY_TYPE=R,
  SEG={SIZ=2,FLD=2,DIR=A},
  SEG={SIZ=20,FLD=3,DIR=A}},
  KEY={DESC="key 5(fi+offset+dec)",MOD=N,DIR=T,RNG=Q,KEY_TYPE=R,
  SEG={SIZ=2,FLD=2,DIR=A},
  SEG={SIZ=2,FLD=5,DIR=A},
  SEG={SIZ=1,FLD=7,DIR=A}}}
  FILE={NAME="index.ddf",DESC="index.ddf",ACCKEY="..SC....",DBNAME="Default Database",ENCR=N,RESIDENT=78,
  FLD={DESC="file id",PIC="2",STRG=5,ATTR=N,SIZ=2,WHLE=2,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="field id",PIC="5",STRG=5,ATTR=N,SIZ=2,WHLE=5,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="key number",PIC="2",STRG=5,ATTR=N,SIZ=2,WHLE=2,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="key segment",PIC="2",STRG=5,ATTR=N,SIZ=2,WHLE=2,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="flags",PIC="5",STRG=5,ATTR=N,SIZ=2,WHLE=5,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         1.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  KEY={DESC="key 1(file id)",MOD=N,DIR=T,RNG=Q,KEY_TYPE=R,
  SEG={SIZ=2,FLD=1,DIR=A}},
  KEY={DESC="key 2(field id)",MOD=N,DIR=T,RNG=Q,KEY_TYPE=R,
  SEG={SIZ=2,FLD=2,DIR=A}},
  KEY={DESC="key 3(file+key num+s",MOD=S,DIR=T,RNG=Q,KEY_TYPE=R,
  SEG={SIZ=2,FLD=1,DIR=A},
  SEG={SIZ=2,FLD=3,DIR=A},
  SEG={SIZ=2,FLD=4,DIR=A}}}
  FILE={NAME="fieldext.ddf",DESC="fieldext.ddf",ACCKEY="..SC....",DBNAME="Default Database",ENCR=N,RESIDENT=78,
  FLD={DESC="File ID",PIC="3",STRG=5,ATTR=N,SIZ=2,WHLE=3,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         0.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="Field ID",PIC="3",STRG=5,ATTR=N,SIZ=2,WHLE=3,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         0.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  FLD={DESC="Extended data type",PIC="3",STRG=5,ATTR=N,SIZ=2,WHLE=3,RSRCE={MDFY=Y,TRNS=S,DEF=N,MOD=B,CTRL=E,CTRL_STP="         0.00000",NUL_ALW=N,STYLE=2,IDX_COLOR=1,IDX_FONT=1}},
  KEY={MOD=S,DIR=T,RNG=Q,KEY_TYPE=R,
  SEG={SIZ=2,FLD=1,DIR=A},
  SEG={SIZ=2,FLD=2,DIR=A}}}
  </code></pre>
  
  <p>Does anyone recognize this format? Can I use this to create DDF files? Or is this usefulfor some other tool?</p>
  
  <p>I have tried using <code>BUTIL -SAVE ORIG.DAT ORIG.TXT</code> and got a more readable file but I'm not quite sure what to do with that either.</p>
  
  <p>Any help is much appreciated.</p>