Maintaining GFB Definitions

A GFB definition defines a global format buffer (GFB) stored separately for reference in SFILE definitions. GFB definitions can be used to decompress replicated data from a specific database file for one or more subscriptions.

While a format buffer specification is required in a subscription's SFILE definition, a stored GFB definition does not need to be used. The SFILE definition could simply include the format buffer specifications it needs.

Notes:

  1. If you will be using the Event Replicator Target Adapter to replicate data to an RDBMS, you must generate your GFB definitions, as described in Generating a GFB.
  2. If you want to use UTF-8 character encoding, you must verify that your GFB field lengths are increased as required to accommodate the character set referenced by the code page you select and the data requested in the GFB. You can increase these field lengths manually by editing the GFB itself or by editing the Predict file or data definition module (DDM) used when the GFB is generated.

Using the Adabas Event Replicator Subsystem you can manually add, modify, and delete GFB definitions. If you have an appropriate version of Predict installed (see Predict Requirements in the Event Replicator for Adabas Installation Guide), you can also generate a GFB. If the correct version of Predict is not installed, you will not be able to use this feature.

This document covers the following topics:


Listing GFB Definitions

Start of instruction setTo use the Adabas Event Replicator Subsystem to list the general format buffer (GFB) definitions stored in the Replicator system file:

  1. Select option G from the Adabas Event Replicator Subsystem Main Menu.

    The List of Global Format Buffers screen appears showing all of the GFB definitions in the Adabas Event Replicator Subsystem.

    18:40:09      ***** A D A B A S  EVENT REPLICATOR SUBSYSTEM *****    2013-02-28
                             List of Global Format Buffers               M-RP1130  
                                                                                   
     Sel   Name         Sel   Name         Sel   Name         Sel   Name           
     ------------       ------------       ------------       ------------         
      _  FILE200         _                  _                  _                   
      _  F040155         _                  _                  _                   
      _  F042060         _                  _                  _                   
      _  F046088         _                  _                  _                   
      _  F062026         _                  _                  _                   
      _  F062029         _                  _                  _                   
      _  F062035         _                  _                  _                   
      _  F062055         _                  _                  _                   
      _  F062079         _                  _                  _                   
      _  F062106         _                  _                  _                   
      _  F062143         _                  _                  _                   
      _  F064121         _                  _                  _                   
      _  F120248         _                  _                  _                   
      _  F215168         _                  _                  _                   
                                                                                   
    Command ==>                                                                    
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Help  Gen   Exit  Add   Repos        -     +                      Menu   

The function keys on this screen perform the following functions:

Function Key Description
PF1/F1 (Help) Provides you with help for this screen.
PF2/F2 (Gen) Allows you to generate GFB if you have Predict 4.4.1 with Service Pack 3 (or higher) installed. A new screen appears.
PF3/F3 (Exit) Returns you to the previous screen.
PF4/F4 (Add) Allows you to add a new definition. A new screen appears.
PF5/F5 (Repos) Provides you with a pop-up panel that allows you to specify the name of the definition you want to locate in the list. Once you have specified a name on the pop-up panel and pressed Enter, the list is repositioned so the name you selected appears first. You can use an asterisk as a wild card character at the end of the definition name or partial definition name you specify on the pop-up panel. Or, you can simply enter the first few characters of the name to reposition the list to the first occurrence in the list of a name starting with those characters.
PF7/F7 (-) Allows you to scroll backwards through the list of definitions.
PF8/F8 (+) Allows you to scroll forwards through the list of definitions.
PF12/F12 (Menu) Returns you to the main menu.

Adding GFB Definitions

You can add global format definitions by typing in the format buffer definition manually or using Predict to generate one for you. This section describes how to add one manually.

Start of instruction setTo use the Adabas Event Replicator Subsystem to add a global format definition manually:

  1. Select option G from the Adabas Event Replicator Subsystem Main Menu.

    The List of Global Format Buffers screen appears.

  2. Press the PF4 function key.

    The Global Format Buffer screen appears.

    18:40:31      ***** A D A B A S  EVENT REPLICATOR SUBSYSTEM *****    2013-02-28
                                 Global Format Buffer                    M-RP1120  
                                                                                   
    GFB Name .. _______  Predict Parameters .. _                                   
    ____________________________________________________________________________   
    ____________________________________________________________________________   
    ____________________________________________________________________________   
    ____________________________________________________________________________   
    ____________________________________________________________________________   
    ____________________________________________________________________________   
    ____________________________________________________________________________   
    ____________________________________________________________________________   
    ____________________________________________________________________________   
    ____________________________________________________________________________   
    ____________________________________________________________________________   
    ____________________________________________________________________________   
                                                                                   
                                                                                   
                                                                                   
                                                                                   
    Command ==>                                                                    
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Help        Exit  Mode  Save        -     +                       Menu   
  3. Tab to the GFB Name field and specify a unique name for the global format buffer definition. The name must be between one and seven alphanumeric characters long.

    Note:
    If, at this point, you want to generate the GFB and field table (GFFT), rather than enter it manually, enter an "S" in the Predict Parameters field. The Predict Parameters screen appears. For more information about generating a GFB, skip the rest of the documentation in this section and read Generating a GFB.

    Caution:
    This "C." option may be used only if the destination target file has been defined with the same fields in the same order as the fields in the source file; if there are differences in the definitions of the files, the replication of the data is likely to incur errors. The only exception to this rule is that the definitions of the descriptors and superdescriptors in the target and source files may be different.

  4. Use the blank lines below the GFB Name field to manually specify the format buffer for this definition. The format buffer must conform to the format buffer requirements (for read commands) documented in the Adabas command reference documentation.

    Use the PF7 and PF8 keys to scroll backwards and forwards through the format buffer definition.

    PE and MU fields cannot use the range notation 1-N in format buffers for a subscription that is sent to a destination that has specified the replication intialization parameter DCLASS=SAGTARG. The SAGTARG application invoked requires that the range of occurrences specified are contained in the record buffer even if they are empty occurrences. 1-N results in a range of 1-191, but unless there are 191 occurrences containing data, space in the record buffer is not allocated for any empty occurrences, resulting in incorrect field positioning when processing the record.

  5. Press PF5 to save the GFB definition.

Generating a GFB

If you have Predict installed, you can generate format buffers and corresponding field tables (GFFTs) from Predict file definitions using the Adabas Event Replicator Subsystem.

Notes:

  1. If you will be using the Event Replicator Target Adapter to replicate data to an RDBMS, you must generate your GFB definitions, as described in this section.
  2. MU and PE fields are supported in the generated format buffers and their corresponding field tables (GFFTs), although MU fields within PE fields are not. This support requires that counters for MU and PE fields be available in the Predict data dictionary definition. Counters for MU and PE fields are available if the Predict data dictionary definition either specifies fields with field types of MC (MU fields with an automatic counter) and PC (PE fields with an automatic counter) OR includes explicit CM field (MU counter field) or CP field (PE counter field) definitions. For more information about CM, CP, MC, MU, PC, and PE field types, refer to your Predict documentation.
  3. PE and MU fields cannot use the range notation 1-N in format buffers for a subscription that is sent to a destination that has specified the replication intialization parameter DCLASS=SAGTARG. The SAGTARG application invoked requires that the range of occurrences specified are contained in the record buffer even if they are empty occurrences. 1-N results in a range of 1-191, but unless there are 191 occurrences containing data, space in the record buffer is not allocated for any empty occurrences, resulting in incorrect field positioning when processing the record.
  4. Exception: This release of the Event Replicator Target Adapter Data Mapping Tool introduces a new option that allows the user to optimize a buffer containing MU's, PE's, and MU's within PE's.
  5. LA and LB fields are not supported in generated format buffers.

Optimized Buffer Option Restrictions

Optimized buffer periodic group fields are generated using the 1-N notation. This indicates that all occurrence values for this field be returned. In order to process the number of occurrences returned in the record buffer correctly, the periodic group field count is requested first, followed by all occurrences of each field defined as a member of the periodic group within the global format buffer (GFB) and global format field table (GFFT).

The count provides the number of occurrences that were returned for each field requested within the periodic group and is used when processing the record buffer.

Some customers may wish to combine 2 or more logically related periodic group fields under one periodic group name so that they are inserted into one RDBMS table by the Event Replicator Target Adapter.

Combining related fields from 2 or more periodic groups under one periodic group requires that all fields have the same number of occurrences. If they do not, then the record buffer will be processed incorrectly starting with the first field that has more or less occurrences than what the count field reported. This may cause the Event Replicator Target Adapter to fail, or bad data to be loaded into the RDBMS.

Optimized Buffer Option Restrictions - Example

 1 | AP | | | PE | |
 2 | AQ | 4 | A | NU | |
 2 | AR | 1 | A | NU | |
 1 | AS | | | PE | |
 2 | AT | 4 | A | NU | |
 2 | AU | 8 | U | NU | |

For this example PE group AS is logically related to PE group AP. PE Group AS fields AT and AU are to be included in the group AP within the DDM used by the Event Replicator Target Adapter Data Mapping Tool to generate the optimized GFB and GFFT. The portion of the GFB for the AP PE group would look like this:

’AP,2,B,AQ1-N,4,A,AR1-N,1,A,AT1-N,4,A,AU1-N,8,U.’

Notice the count for the AP group is first, followed by the 4 PE group fields that are to be defined as members of the periodic AP group.

When the GFB was generated, an internal global format field table (GFFT) was also generated. This table defines the 4 fields AQ, AR, AT, and AU as belonging to the periodic group AP. In order for this to work correctly, the fields AT and AU from the AS PE group must have the same occurrence count as the fields in the PE group AP.

If the count field returned for the periodic group AP is 5, but the periodic group AS fields AT and AU only have 3 occurrences each, then they should not be included as being members of the AP periodic group in the DDM or Predict user view used to generated the GFB and GFFT definitions.

Start of instruction setTo use the Adabas Event Replicator Subsystem to generate global format buffer definition using Predict:

  1. Select option G from the Adabas Event Replicator Subsystem Main Menu.

    The List of Global Format Buffers screen appears.

  2. Press the PF2 function key.

    The Predict Parameters screen appears.

    18:40:54      ***** A D A B A S  EVENT REPLICATOR SUBSYSTEM *****    2013-02-28
    FDIC=(1955,13)                Predict Parameters                     M-RP1121  
                                                                                   
    GFB Name .......... _______                                                    
                                                                                   
    File ID ......... * ________________________________                           
    Target file ID .. * ________________________________                           
                                                                                   
    ----------  Generation Information ----------                                  
                                                                                   
    User ..............                                                            
    Date ..............                                                            
    Time ..............                                                            
    FDIC .............. DBID ..       FNR ..                                       
                                                                                   
    Adabas version ....                                                            
    Occurrences used ..                                                            
    Full format .......                                                            
                                                                                   
                                                                                   
    Command ==>                                                                    
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Help        Exit        Exec  Sel   Unlnk                         Menu   
  3. Update the following fields on this screen as described in this table.

    Parameter Name Specify Default
    File ID The name of a Predict file with a file type or Adabas (A) or Adabas user view (U).

    Place your cursor on this field and press PF6 to select a file from a List of Predict Files screen. To select from the list screen, type an "S" next to the file you want to use and press PF5.

    ---
    GFB Name A unique name for the global format buffer definition. The name must be between one and seven characters long. ---
    Target file ID The name of a Predict file with a file type of sequential (S). This file may be used to insert space notation (nX) into the format buffer. For fields in the target file with matching definitions in the File ID file (in other words, if a field exists with the same field long name), a short name clause is generated. For fields that do not have a matching definition in the File ID file, an appropriate space notation (nX clause) is generated. The spaces defined by nX clauses can be filled using a user exit.

    Place your cursor on this field and press PF6 to select a file from a List of Predict Files screen. To select from the list screen, type an "S" next to the file you want to use and press PF5.

    ---

    When you first create a definition, the remaining fields on this screen are blank. However, when you modify the definition later, they are filled in, although you cannot modify them. These display-only fields are described in the following table:

    Parameter Name Displays
    Adabas version The version of Adabas for which the global format buffer was generated.
    Date The date the global format buffer was generated.
    FDIC (top of the screen) The current database and file number of the Predict file.
    FDIC...DBID...FNR The database and file number of the Predict file.
    Full format Whether the full format buffer was generated. The full format buffer includes the length and format of Adabas fields. A value of "Y" indicates that the full format buffer was generated; a value of "N" indicates it was not.
    Occurrences used How multiple occurrences of PE and MU fields are generated in the GFB and resulting field table (GFFT). A value of "M" indicates that the maximum number of occurrences should be generated (191); a value of "N" indicates that no occurrences will be generated; a value of "Y" indicates that the number of occurrences defined by the Predict Occ attribute should be generated.
    Time The time of day the global format buffer was generated.
    User The user ID of the user who generated the global format buffer.
  4. When you have supplied values for the File ID, GFB Name, and Target file ID fields, press PF5 to start generating the global format buffer.

    A small window appears requesting more information.

    +-----------------------------+
    ! Adabas Version ...* I7      !
    ! Occurrences used..* Y       !
    ! Full format ....... Y (Y/N) !
    +-----------------------------+
  5. Update the fields on this screen as described in the following table:

    Parameter Name Specify Default
    Adabas Version The version of Adabas for which the global format buffer will be generated. The version should be expressed as "I7" or "R7". If you want special fields and descriptors included in the generated GFB and corresponding field tables (GFFTs), specify "R7". I7
    Full format You cannot edit this parameter. It indicates that the full format buffer should be generated. Y
    Occurrences used How multiple occurrences of PE and MU fields are generated in the GFB. A value of "M" indicates that the maximum number of occurrences should be generated (191); a value of "N" indicates that no occurrences will be generated; a value of "Y" indicates that the number of occurrences defined by the Predict Occ attribute should be generated. Y
  6. When these fields are set to your liking, press ENTER.

    The global format buffer definition and field table (GFFT) are generated and the Global Format Buffer screen appears.

    18:40:54      ***** A D A B A S  EVENT REPLICATOR SUBSYSTEM *****    2013-02-28
                                 Global Format Buffer                    M-RP1124  
                                                                                   
    GFB Name .. GBF037_  Predict Parameters .. _ +                     19 of 78    
                                                                                   
    Ty L Field ID                         R  K KNum Flatten  Format Buffer         
          F  Cs  Length (2nd line)                                                 
       1 MARCA-DEFINITIVA                 _  _  __   _       AY,1,U                
          N           1.0                                                          
       1 FECHA-INFORMATICA                _  _  __   _       AZ,4,P                
          D           4.0                                                          
       1 FX-FSE-SEG-ACC                   _  _  __   _       BD,4,U                
          N           4.0                                                          
    MU 1 ID-RESUL-UN(1-191)               _  _  __   _       CU1-191,1,U           
          N           1.0                                                          
    MU 1 ID-RESUL-FC(1-191)               _  _  __   _       CF1-191,1,U           
          N           1.0                                                          
    CP 1 C_PRACTICAS-NOLAB                _                  BGC,2,B               
          B           2.0                                                          
                                                                                   
    Command ==>                                                                    
    Enter-PF1---PF2---PF3---PF4---PF5---PF6---PF7---PF8---PF9---PF10--PF11--PF12---
          Help        Exit  Mode  Save        -     +                       Menu   

    Note:
    SQL Significance Indicator fields are marked with an "_S" in the Ty field (field type column).

  7. Optionally, modify the Cs, R, K, Knum, or Flatten settings for the fields, as described in the following table:

    Setting Valid Values Description
    Cs "C" or blank This setting indicates whether or not the field content should be converted to character format in the destination user exit. The Cs setting is only modifiable for non-counter fields in binary format with lengths of 1-8 characters. Valid values are C (convert to the field content to character) or blank (do not convert the field content).

    Note:
    This field cannot be modified for counter fields (Ty field set to "CM" or "CP") and SQL Significance Indicator fields (Ty field set to "_S").

    R "Y" or blank This setting indicates whether or not the field is read-only. Read-only fields are not replicated. A value of "Y" indicates that the field is read-only (not replicated); a blank value indicates that the field is not read-only and is replicated.

    Note:
    When you initially generate or regenerate the GFB and field table (GFFT), the value of the R setting for all fields is blank.

    K "D", "P", "U", or blank This setting indicates the kind of key field that the field represents. Possible values are:
    • "D" -- identifies a descriptor key field

    • "P" -- identifies a primary key field. Only one field in the table can be marked with a "P" unless you also supply a KNum value, indicating that the field is part of a composite key.

      Note:
      At this time, multiple-value (MU) and periodic group (PE) fields cannot be specified as primary keys or in composite keys if Event Replicator Target Adapter processing will be invoked by the subscription (if the DCLASS parameter of the destination used by the subscription is set to "SAGTARG").

    • "U" -- identifies a UQ descriptor key field

    • blank -- identifies a non-key field

    Notes:

    1. When you initially generate or regenerate the GFB and field table (GFFT), the key fields are set to "D", "U", or blank, depending on the Predict definitions for those fields.
    2. This field cannot be modified for counter fields (Ty field set to "CM" or "CP") and SQL Significance Indicator fields (Ty field set to "_S").
    KNum 1 - 63 or blank

    KNum can be specified when the K setting is "P" and when a composite key is needed. Specify a value from 1-63 to identify the order of the fields in the composite key. If no composite key is needed, leave the KNum setting blank.

    Flatten "F" or blank Use the "F" setting to indicate that an MU or PE field should be flattened when it is replicated to any relational database tables using the Event Replicator Target Adapter. Otherwise, leave this field blank.

    By default, when MU and PE fields and subfields and superfields are included in replicated data in RDBMS targets (via the Event Replicator Target Adapter), additional tables are created. However, you can request that individual MU and PE fields, subfields, and superfields be flattened in the replicated data instead. This process of flattening fields will replicate them as columns in the main RDBMS table, rather than as separate subtables. If you want to flatten a field in the resulting RDBMS table, you must identify it in the GFB and field table (GFFT) for the field. If you do not explicitly trigger a field to be flattened in the GFB and GFFT, it will not be flattened in the resulting RDBMS tables.

  8. Once all changes are made, press PF5 to save the generated global format buffer definition.

Modifying GFB Definitions

Start of instruction setTo use the Adabas Event Replicator Subsystem to modify a global format buffer (GFB) definition in the Replicator system file:

  1. List the GFB definitions in the Adabas Event Replicator Subsystem, as described in Listing GFB Definitions.

    The GFB definitions are listed on the List of Global Format Buffers screen.

  2. Locate the definition you want to modify on the screen and enter an M in the Sel column for that definition.

    You can locate the definition you want in the list by pressing the PF7 (F7) or PF8 (F8) keys to scroll through the list. You can also press PF5 (F5) to specify the name of the definition to which the list should be repositioned.

    The Global Format Buffer screen for the GFB you selected appears .

  3. Manually modify the GFB definition on this screen.

    For information on manually modifying this screen, read the description of Adding GFB Definitions.

    Or:
    If the Predict Parameters field has a plus (+) symbol next to it, the GFB was originally generated by the Adabas Event Replicator Subsystem. Enter an "S" in the Predict Parameters field to regenerate the GFB on the Predict Parameters screen. For information about generating a GFB, read Generating a GFB

  4. When all modifications have been made, press PF5 to save the changes.

Unlinking a Generated GFB from its Predict Generation Information

If a GFB definition has been generated from Predict and it has been saved, you can unlink the Predict generation information from the generated GFB definition.

Start of instruction setTo use the Adabas Event Replicator Subsystem to unlink the Predict generation information from the GFB:

  1. Access the GFB definition, as described in Modifying GFB Definitions. Be sure to enter an "S" in the Predict Parameters field of the Global Format Buffer screen. This will allow you to access the Predict Parameters screen for that GFB.

  2. Once the Predict Parameters screen associated with the GFB appears, click PF7 to unlink the Predict generation information from the GFB.

    The Global Format Buffer screen appears.

  3. Press PF5 to save the GFB definition.

Copying GFB Definitions

Start of instruction setTo use the Adabas Event Replicator Subsystem to copy a global format buffer (GFB) definition in the Replicator system file:

  1. List the GFB definitions in the Adabas Event Replicator Subsystem, as described in Listing GFB Definitions.

    The GFB definitions are listed on the List of Global Format Buffers screen.

  2. Locate the definition you want to copy on the screen and enter a C in the Sel column for that definition.

    You can locate the definition you want in the list by pressing the PF7 (F7) or PF8 (F8) keys to scroll through the list. You can also press PF5 (F5) to specify the name of the definition to which the list should be repositioned.

    A dialog appears requesting a name for the copy of the GFB definition.

                                   
                                   
      Enter new name: ________     
      or press ENTER to cancel     
                                   
                                   
  3. Specify a new, unique name for the copy of the GFB definition and press Enter.

    The GFB definition is copied and the copy appears on the List of Global Format Buffers screen.

Deleting GFB Definitions

Start of instruction setTo use the Adabas Event Replicator Subsystem to delete a global format buffer (GFB) definition in the Replicator system file:

  1. List the GFB definitions in the Adabas Event Replicator Subsystem, as described in Listing GFB Definitions.

    The GFB definitions are listed on the List of Global Format Buffers screen.

  2. Locate the definition you want to delete on the screen and enter a D in the Sel column for that definition.

    You can locate the definition you want in the list by pressing the PF7 (F7) or PF8 (F8) keys to scroll through the list. You can also press PF5 (F5) to specify the name of the definition to which the list should be repositioned.

    The GFB definition is deleted.