javadatabase-migrationunidata

How data is structured in Tables in unidata


I am Extracting dictionary info and data(flat files) for the unidata tables through a java program where i used 'table name' for getting both the things, now we are having other project where the Unidata db is divided into multiple modules(Directories) each directory contains files and more directories, Now my question is 1)how can we say a particular file is Unidata table? 2)for some files we able to get dictionary info but not data, are these two things are not available at same location ? if not, how can we relate both the things?
I am very new to Unidata, please ignore my naiveness on this subject and shed some light. Thanks


Solution

  • If you login to Unidata and look at it from inside, it's may be little clearer. A unidata "account" (database) contains files and dictionaries. A file is like a database table, but with no metadata about the contents or columns. A dictionary is a special kind of table that does contain metadata about the corresponding file. So if I do:

    :CREATE.FILE MY.FILE 37,1
    Create file D_MY.FILE, modulo/1,blocksize/1024
    Hash type = 0
    Create file MY.FILE, modulo/37,blocksize/1024
    Hash type = 0
    Added "@ID", the default record for UniData to DICT MY.FILE.
    

    I get two unix-level files created in the current account. Both are empty. Because I didn't specify, the system created a hashed file, as well as a pointer in the "master dictionary" or VOC.

    :ED VOC MY.FILE
    Top of "MY.FILE" in "VOC", 3 lines, 19 characters.
    *--: P
    001: F
    002: MY.FILE
    003: D_MY.FILE
    Bottom.
    

    The first attribute tells us the type of file. The 2nd and 3rd are pointers to where the data and dictionary files are (they don't have to be in the current account). Other types include DIR-type, LD (multi-level files where there are sub-files with a shared dictionary) and some less usual combinations. More info from:

    :HELP CREATE.FILE
    CREATE.FILE
    
    Syntax
    
    CREATE.FILE [DICT | DATA] [DIR | MULTIFILE | MULTIDIR] filename [,subfile]
    [modulo [,block.size.multiplier]] [TYPE hashtype] [DYNAMIC [KEYONLY
    | KEYDATA] [PARTTBL part_tbl]] [RECOVERABLE] [OVERFLOW]
    Note: The PARTTBL option is available on UniData for UNIX only.
    Synonym
    CREATE-FILE
    
    Description
    
    The ECL CREATE.FILE command creates a UniData file. If you do not
    indicate the kind of file to create (such as dictionary, data, or
    directory), UniData creates filename (both the data and dictionary
    files) as a static hashed file. If an operating system-level file
    of the same name already exists in the target account, CREATE.FILE
    fails.
    

    So, if you're successfully extracting data already, but want to know about the type of new tables and where their dictionaries are, the answer is to look in the VOC table.