HAT 5 Text File Format

File type and version

  • Format:
    ##HAT-Text   {version}
  • Description:
    ##HAT-Text   = file identifier
    {version}    = version number for this text file format,
    {year}       = 2 digits, 9x = years 1990..1999
                             0x = years 2000..2009
                             1x = years 2010..2019
    {month}      = 2 digits, 01..12
    {day}        = 2 digits, 01..31
  • Example:
    ##HAT-Text   080813
  • Comments:

    All HAT text files must begin with this line, otherwise the file is not considered as a HAT text file. Version number is the date when this format was frozen. Future versions of HAT will increment this value.

    Note: The year is expressed in only two digits. Years 2000 and beyond have smaller numeric values than years before 2000.

    Short version history:
    981104 HAT 4.0
    981105 HAT 4.1
    001219 HAT 5.0 - 5.1
    041020 HAT 5.2
    051004 HAT 5.3
    080813 HAT 5.4 - 5.5
    121122 HAT 5.6

Characters Section

  • Format:
    U     {uppercase}
    L     {lowercase}
    X     {special}
  • Description:
    ##Characters = section header
    {uppercase} = international uppercase characters:
    {lowercase} = international lowercase characters:
    {special} = some special characters:
  • Comments:

    HAT-Text files may include this section to ensure that international and special characters are correctly handled. Text files always use native character set in an operating system, but when moving a text file over an operating system boundary, character conversion may or may not occur. This character section included in a text file is converted the same way as the rest of the file ensuring correct interpretion.

    If some characters do not exist in an operating system, a space character should be used as a placeholder for them.

    If you are workng in one operating system only, you can safely ignore this section.

Protection Section

  • Format:
    ##Protection   {password}
    {processor}    {username}     {userkey}
    {processor}    {username}     {userkey}
  • Description:
    ##Protection   = section header
    {password}     = password currenty in use
    {processor}    = serial number of a HAT processor
    {username}     = user's name or other description of the HAT installation
    {userkey}      = user's userkey as defined in the "License" dialog in File menu
  • Example:
    ##Protection   sesam
    AA24N007       D.Garrison
    AA24P012       C.Bellman
    BD08P006       Sales Manager       1118 1369 7299 7484 2542 1746 6388 1240 0868
    BD22P011       Reserved for future
    ZZ99P999       D.Hamilton-Jones    7299 1118 6388 1240 0868 1369 7484 2542 0104
    ZZ99P999       Mr Pickwick         6388 1240 0868 1369 7484 2542 7299 0104 2844
  • Comments:

    This section limits access to a HAT database. A password for the database can defined, as well as a list of HAT installations which may be used to open this file.

    A password may contain any alphanumeric characters. Passwords are case insensitive: upper and lower case characters are considered to be the same.

    A list of HAT installations consists of lines referring to a physical HAT Processor and/or a "User key" found in "License" dialog in File menu. If a line refers to a "user key" only, a placeholder code must be entered in the first column. This placeholder code "ZZ99P999" ensures that older HAT versions (prior to 5.2) do not open this file without a proper processor. "ZZ99P999" is a valid HAT Processor serial number, but there is no such a processor, and will never be.

    If no installation list is defined, the file can be accessed with any HAT installation.

    Protection section limits access to the file containing it. This information is not changed when importing a file into an open database. Protection information is checked to allow/disallow importing the data file. The original protection information for the database remains in effect when saving and reopening the original file.

    Note: Activation key based HAT installations were introduced in HAT 5.2. Earlier HAT versions skip the field containing the userkey information completely. Be careful when reading HAT files with an earlier version of HAT: if a file is saved, the userkey information is dropped - possibly rendering the file unreadable by other installations.

    Note: Password is shown in this text file openly as plain characters. Full password protection is ensured when a file is saved as an encrypted HAT normal file.

Web Users Section

  • Format:
    U       {username}         {password}
    SG      {subsetexpr}
    TF      {templatefilter}
    LG      {weblang}
    FR      {weblang}
    U       {username}         {password}
  • Description:
    ##WebUsers        = section header
    U                 = selector for a new web user
    {username}        = login name for the web user
    {password}        = password for the web user
    SB                = allow Shibboleth authentication       (HAT 5.4.1 and later)
    SG                = specify user's global subset          (HAT 5.1.1 and later)
    {subsetexpr}      = global subset expression string
    TF                = specify template filter
    {templatefilter}  = filter string for template names
    CL                = allow the web user to see cards       (HAT 5.5 and later)
    CN                = allow the web user to see card notes  (HAT 5.5 and later)
    BI                = allow the web user to see database info
    LG                = user's default language               (HAT 5.4.1 and later)
    FR                = user's default format                 (HAT 5.4.1 and later)
  • Example:
    U       Bob           sesam
    U       Peter         secret
    SG      Transactions for Sweden
    TF      peter|sweden
    LG      SWE
    U       Jack          geek123
  • Comments:

    A line beginning with U defines a new web user. Lines that come after that but before next U line define settings for that user.

    Shibboleth authentication allows Web-HAT users to bypass the normal login procedure if they have aldready logged into a corporate network. Make sure to use exactly identical username in corporate network and web-HAT.
    This feature is available in HAT 5.4.1 and later.

    A global subset expression limits web user's access to a subset of the database. All templates are temporarily modified to reflect this scope. The expression may contain global subset names and subset operators. It can be empty, in which case all cards and lines are available for that web user.
    This feature is available in HAT 5.1.1 and later.

    A template filter is used to define which templates are visible to the web user. The template filter can be empty, in which case all templates are shown.

    Database info is not shown by default. It can be shown selectively for each user by adding a BI line.

    Web-HAT supports currently three languages: English, Swedish and Finnis. By default, Web-HAT server uses the language that is chosen on the web server (program preferences for HAT). That can be overriden by settings here for each web user. Finally web users can select their language using the left pane in the web interface.

    There are separate settings for language and format. Language setting affects panes, titles, messages and other texts. Format setting affects dates and numbers.
    This feature is available in HAT 5.4.1 and later.

    Note: Web Users section is available in HAT 5.1 and later.

Database Options Section

  • Format:
    CN   {ordinaldigits}
    CD   {decimals}     {decimals}     {decimals} ...
    CT   {cardtitle}
    LT   {linetext}
    LV   {valuetitle}   {valuetitle}   {valuetitle} ...
    LN   {valuefields}
    R    {reference}
  • Description:
    ##BaseOptions     = section header
    {ordinaldigits}   = number of ordinal digits in Card ID (1..5)
    {decimals}        = number of decimals in card values for each value field (0..6, F)
    {cardtitle}       = custom title for card titles
    {linetext}        = custom title for line texts
    {valuetitle}      = custom title for line values for each value field
    {valuefields}     = number of value fields on each line (1..24)
    LH                = store origin of lines                        (HAT 5.4 and later)
    {reference}       = reference ID (may include Card ID operators)
  • Example:
    CN   3
    CD   2
    LT   Description
    LV   Amount
    R    921002-999#
  • Comments:

    Selector order is not significant.
    Database options section can be skipped. In that case the default values are used.

    Note: Separate decimal settings for each value field are available in HAT 5.2 and later. Earlier HAT versions use a single setting for all fields.
    Note also that the decimal setting F = "Floating" is only available in HAT 5.2 later.

Save Setup Section

  • Format:
    ##SaveSetup  {name}
  • Description:
    ##SaveSetup     = Section header
    {name}          = Name of this save setup
    {selector}      = Save setup data
      Currently defined selectors:
        FN       = use "Analyser" file format
        FB       = use "Browser" file format
        FT       = use "HAT-text" file format
        FS       = use "SIE 4" file format    (HAT 5.4 and later)
        SH+      = include characters section
        SH-      = exclude characters section
        SP+      = include protection section
        SP-      = exclude protection section
        SW+      = include web users section  (HAT 5.2 and later)
        SW-      = exclude web users section  (HAT 5.2 and later)
        SB+      = include base options section
        SB-      = exclude base options section
        SS+      = include save setup sections
        SS-      = exclude save setup sections
        SI+      = include import setup sections
        SI-      = exclude import setup sections
        ST+      = include time scale sections
        ST-      = exclude time scale sections
        SX+      = include base macro sections
        SX-      = exclude base macro sections
        SD+      = include dimension sections
        SD-      = exclude dimension sections
        SC+      = include card section
        SC-      = exclude card section
        SM+      = include analysis templates section
        SM-      = exclude analysis templates section
        SG+      = include analysis defaults section
        SG-      = exclude analysis defaults section
        DF   {dimfilters}  = dimension component filters for each dimension
                 {dimfilters} = {filter}{filter}{filter}...
                 {filter} =
                    A  = include all components
                    C  = include active components only
                    U  = include components in use only
                    N  = exclude all components
        DL   {dimlinks}  = dimension reference link codes for each dimension
                 {dimlinks} = {link}{link}{link}...
                 {link} =
                    C  = use HAT-codes
                    H  = use host codes
                    T  = use dimension texts
        BD{dim}   {expr}     = dimension expressions for card selection
        BC   {from}   {to}   = card IDs for card selection
        BY   {expr}          = card title expression
        BL   {expr}          = line text expression
        BV{val}   {expr}     = value expressions
        CT                   = include cards/lines referred in templates only
        GC                   = include complete cards in card selection
        GG                   = include complete groups in card selection
        GL                   = include selected lines only in card selection
        TF   {expr}          = template filter expression
        TO+                  = include open templates only
        TO-                  = disable "open templates only" feature
        M{dim}  -            = exclude dimension {dim} from all sections
        M{dim}  {srcdim}     = map dimension {srcdim} to {dim} in all sections
      following selectors are used in SIE 4 format and are available in HAT 5.4 and later
        RC   {text}        = company name
        RO   {text}        = org number
        RV   {text}        = ver serie
        RN   {text}        = notes
        Rr+                = include ver registration date
        Rr-                = exclude ver registration date
        Ru+                = use HAT-Code if no host is defined
        Ru-                = use host codes only, warn if host codes are missing
        Rk+                = include account section
        Rk-                = exclude account section
        Rd+                = include dimension sections
        Rd-                = exclude dimension sections
        Rv+                = include card section
        Rv-                = exclude card section
        RF   {dimfilters}  = dimension component filters for each dimension
        RD{dim}  {siedim}  = SIE dimension mapping
                  {siedim} =
                     K       account dimension
                     {num}   other dimension numbers, 1 and larger
  • Example:
    ##SaveSetup  SS1
    DF   ACAA
    BD2  T Tulot
    TF   Dine
    M4   3
  • Comments:

    The Web Users section selector "SW" is available in HAT 5.2 and later.

Import Setup Section

  • Format:
    ##ImportSetup   {name}
  • Description:
    ##ImportSetup   = Section header
    {name}          = Name of this import setup
    {selector}      = Import setup data
    Currently defined selectors:
        FV       = Variable field lengths
        FX       = Fixed field lengths
        A   {encoding}  = Character encoding                (HAT 5.6 and later)
        AM   = ASCII Extended Macintosh character set     (HAT 5.5 and earlier)
        A7   = ASCII 7-bit character set                  (HAT 5.5 and earlier)
        AP   = IBM-PC character set                       (HAT 5.5 and earlier)
        AW   = ANSI Windows character set                 (HAT 5.5 and earlier)
        AE   = EBCDIC character set                       (HAT 5.5 and earlier)
        CC             = UTF-8: Count character positions   (HAT 5.6 and later)
        CB             = UTF-8: Count byte positions        (HAT 5.6 and later)
        PX             = Exclude control characters from position calculations
        PI             = Include control characters in position calculations
        PS  {string}   = Exclude other characters from position calculations
                         (exclude characters completely)  (HAT 5.1.1 and later)
        T   {integer}   = Row Terminator (Unicode codepoint)
        S   {integer}   = Field Separator (Unicode codepoint)
        D   {integer}   = Decimal Separator (Unicode codepoint)
        RC  {integer}   = Number of rows for card information
        RL  {integer}   = Number of rows for line information
        RX  {integer}   = Number of rows to exclude at the beginning
        CF  {string}    = These two selectors define character conversions.
        CT  {string}    = Character in CF-string is converted to character
                          at same position in CT-string.
        CS  {string}    = Exclude characters in text fields
                          (included in position calculations)
        CR  {txconv}    = Text conversion for card title field
        CN  {txconv}    = Text conversion for notes field
            {txconv} =
               -   No conversion
               U   All characters are converted to upper case
               L   All characters are converted to lower case
               S   First character is converted to upper case, all others to lower case
               W   First character of each word is converted to upper case, all others
                   to lower case
        M   {dateformat} = Date format
            {dateformat} =
               YYMMDD   YYDDMM   MMDDYY   DDMMYY
               Y/M/D    Y/D/M    M/D/Y    D/M/Y
        -               = Separator line for multiple line definitions
        V   {float}     = Scaling factor for values
        ZK              = Do not exclude zero lines
        ZF{dim}   {int} = Zero filling of dimension codes
        ZN{dim}   {newcomps} = How new components are added to dimensions
            {newcomps} =
               -   New components under # using numbers
               C   New components under # using host codes   HAT 5.3 and later
               H   New components in hierarchy using host code as a HAT-code
               N   New components in hierarchy finding the neares existing host code
        ZC  {txconv}    = Text conversion for line text field
    Field definitions are stored in selectors beginning with an 'L'.
    Following format and selectors are used:
    {FSelector}   {FCode}   {FCode}   {FCode}   ...
      {FSelector} =
         LX      = Card Switcher
         LC      = Card Indicator
         LL      = Line Indicator
         LI      = Card ID
         LT      = Card Title
         LN      = Notes
         Lc      = Created
         Lm      = Modified
         Le      = Examined
         La      = Approved
         L{dim}  = Dimensions
         LZ      = Line Text
         LV{val} = Values
      {FCode} =
         F{integer}   = Field number
         B{integer}   = First character position
         E{integer}   = Last character position
         T{text}      = Comparison text / default value
         S{text}      = Separator string                     HAT 5.3 and later
         +            = implication of next part of the field
         +{integer}   = ASCII code of a separator char       used before HAT 5.3
                        and implication of next part
  • Example:
    ##ImportSetup   FlatFormat
    T    13
    D    46
    CF   {}|
    CT   äåö
    CS   ´`«
    LI   1   0   0
    LVA  3   0   0
    L1   0   0   0   IH
    L2   2   0   0

Subset Section

    There are two types of subsets in HAT, global and local.

    Note that subset names must follow certain rules. Blanks and set operators are not allowed in them. These restrictions simplify further usage of subset names in expressions.

Global Subsets

    The global subsets are accessible to all analyses.
    They are stored in subset sections, one subset in each section.

  • Format:
    #Subset    {name}
  • Description:
    ##Subset       Section header
    {name}         Name of the global subset
    {selector}     These selectors define the details of the subset.
    Subset variable seletors:
    VN       {name}        Name (must be the first line)
    VD{dim}  {expr}        Dimension expressions
    VY       {expr}        Card title expression
    VL       {expr}        Line text expression
    VV{val}  {expr}        Value expressions
    VS       {expr}        Subset expression (only for local subsets)
    Vk  {expr}             Card ID expression
    VA  {expr}             Notes expression
    Vc  {time}  {sign}     Card created expressions
    Vm  {time}  {sign}     Card modified expressions
    Ve  {time}  {sign}     Card examined expressions
    Vp  {time}  {sign}     Card approved expressions
    Va  {time}  {sign}     Notes signature expressions
                           {time}  = Time expression
                           {sign}  = Signature expression
    V-                     Delete variable. Used with Modify macro command.
    Subset other seletors:
    F  {expr}              Formula expression
    N  {notes}             Subset user notes
    xo                     Open direct
    xp  {int}  {int}       Window position in global coordinates (x,y)
  • Example:
    #Subset    Foo
    VN  A
    Ve  \
    F   A

Local Subsets

    Local subsets are defined for a single analysis. They are not accessible to other analyses, and their definition is embedded in an analysis template definition. All local subset selectors begin with s.

  • Format:
    sn   {name}
  • Description:
    {name}         Name of the local subset
    {selector}     These selectors define the details of the subset.
    Subset variable seletors:
    sN       {name}        Name (must be the first line)
    sD{dim}  {expr}        Dimension expressions
    sY       {expr}        Card title expression
    sL       {expr}        Line text expression
    sV{val}  {expr}        Value expressions
    sS       {expr}        Subset expression (only for local subsets)
    sk  {expr}             Card ID expression
    sA  {expr}             Notes expression
    sc  {time}  {sign}     Card created expressions
    sm  {time}  {sign}     Card modified expressions
    se  {time}  {sign}     Card examined expressions
    sp  {time}  {sign}     Card approved expressions
    sa  {time}  {sign}     Notes signature expressions
                           {time}  = Time expression
                           {sign}  = Signature expression
    s-                     Delete variable. Used with Modify macro command.
    Subset other seletors:
    sf  {expr}             Formula expression
    sx  {notes}            Subset user notes
  • Example:
    sn   S1
    sN   K
    sD2  C Costs
    sV   20
    sf   K

Contents Next