This discussion is archived
3 Replies Latest reply: Dec 10, 2012 9:44 PM by NirmalGarga RSS

How to add TagLogicalElement (TLEs)

NirmalGarga Explorer
Currently Being Moderated
Hi Experts,

Is anyone aware of how to add TagLogicalElement (TLEs) into Documaker produced AFP output files?

  • 1. Re: How to add TagLogicalElement (TLEs)
    VamshiMundla Explorer
    Currently Being Moderated
    Hi Nirmal,

    I never tried that but while searching documents I found this. I am not sure this will help you out or not. :)

    You can add TLE (Tag Logical Element) records into AFP print streams which can be used by some 3rd-party archive systems to archive AFP print streams in a manner
    similar to archiving AFP or Metacode print streams in Docusave.

    You must include comment records in the print streams to index the archive. You can use a DAL script to add comment records into the print stream. Use the TLEScript option n the PrtType:AFP control group to name the DAL script to execute when TLE records can be added into the print stream. The DAL script should call the AddComment function to add a string as a TLE comment record.

    The TLE comment string must include a key and a value. Separate these components with a special character. This character can be any printable character as long as it is a unique character not found in the key or value portion of the comment string.

    For example, you might build a comment string using a colon (:) as a separator as in the following example:


    The key portion of the string is PolicyNum, the value portion of the string is 7SAMPCO, and the separator character is a colon (:).

    Here is an example of what TLE DAL script might look like:
         cidlabel = 'PolicyNum'
         clientid = GVM("PolicyNum")
         colon = ':'
         AddComment (cidlabel & colon & clientid);

    Notice that the key portion remains constant (PolicyNum) while the value portion changes based on the contents of the GVM variable, PolicyNum.

    Add these options to the PrtType:AFP control group to enable TLE record support:
         < PrtType:AFP >
         TLEScript = TLE.DAL
         TLEEveryPage= No
         TLESeparator= :

    Option Description
    TLEScript Enter the name of the DAL script to execute.
    TLESeparator Enter the character you want to use to separate the key and value portions of the TLE comment string.
    TLEEveryPage Optional. If you enter Yes, the TLE DAL script will be executed at the start of every page. If you enter No, the TLE DAL script will be executed at the start of every form set. The default is No.

    Vamshi Mundla
  • 2. Re: How to add TagLogicalElement (TLEs)
    user9976633 Explorer
    Currently Being Moderated
    If you are using TLEs for archiving with IBM's OnDemand, you might also need to give the Begin Page (BPG) and End Page (EPG) records the name of the form used to create each page. This can be accomplished using the BPGScript DAL script functionality which is available in release 12.0 patch p02 and higher.

    I have copied the following from the Printers Reference guide which you can find at

    Adding Data to Begin Page and End Page Records

    The AFP MO:DCA structured records for Begin Page (BPG) and End Page (EPG)
    include an 8-byte field that you can use to store the name of the form used to create
    the page. Adding form names to these records can allow certain AFP archival
    products to re-assemble portions of documents, instead of having to deliver the entire

    Use the BPGScript option to add this data to the AFP Begin Page and End Page
    records. Here is an example:
    < PrtType:AFP >
    BPGScript = example.dal

    The DAL script you specify should contain a call to the AddComment function. The
    script can pass any string as a parameter to the AddComment function but strings
    longer than eight bytes are truncated.

    For example, if you wanted to write the form name into the BPG (Begin Page) and
    EPG (End Page) records, your DAL script could include the following lines:
    form_name = FormName()

    The BPGScript DAL script is similar to other functionality for adding comments to
    AFP print streams, such as DocusaveScript, OnDemandScript, and TLEScript. You
    can use any combination of these script INI options.

    Keep in mind...
    • AFP records normally contain EBCDIC data. By default, the AddComment
    function converts the string to EBCDIC.
    • Do not use the AddComment option to write ASCII text.
    • Use only 7-bit ASCII characters in strings added via the AddComment function
    because 8-bit ASCII characters may be translated to EBCDIC characters other
    applications will not understand.
    • AFP archival products may have specific requirements for the text in Begin Page
    (BPG) and End Page (EPG) records. For example, they may not expect spaces
    within the text. Make sure that you address these requirements when creating the
    AddComment strings in your DAL script.
  • 3. Re: How to add TagLogicalElement (TLEs)
    NirmalGarga Explorer
    Currently Being Moderated
    Thanks a lot guys :)


  • Correct Answers - 10 points
  • Helpful Answers - 5 points