Previous Topic Next topic Print topic


Substitution Markers

Substitution markers enable you to pass variable data from your COBOL program directly into HTML output by coding specifications into your embedded HTML markup.

Format 1, unqualified substitution marker

:cobol-data-name

Format 2, qualified substitution marker

:group-data-name.elementary-data-name

Parameters

cobol-data-name
Any data name defined to the COBOL program.
group-data-name
The name of a group-level qualifer for the elementary-data-name.
elementary-data-name
A data name defined to the COBOL program and qualified by the group-data-name.

Syntax Rules

  1. A colon followed by a space is treated as a colon, not as the beginning of a substitution marker.
  2. A colon preceded by a backslash (\) character is treated as a colon, not as a substitution marker.
  3. A :data-name reference is not treated as a substitution marker if it is preceded by any of the following:
    • data
    • clsid
    • layout
    • javascript
    • about
    • http
    • https
    • file
    • ftp
    • mailto
    • news
    • gopher
  4. A :data-name reference is not treated as a substitution marker if it is preceded by any of the following style sheet attributes supported by Internet Explorer 4.0 and above:
    !important border-top-style margin-bottom
    @font-face border-top-width margin-left
    @import border-width margin-right
    active clear margin-top
    background clip overflow
    background-attachment color padding
    background-color cursor padding-bottom
    background-image display padding-left
    background-position filter padding-right
    background-repeat float padding-top
    border font page-break-after
    border-bottom font-family page-break-before
    border-bottom-color font-size position
    border-bottom-style font-style text-align
    border-bottom-width font-variant text-decoration
    border-color font-weight text-indent
    border-left height text-transform
    border-left-color hover top
    border-left-style left vertical-align
    border-left-width letter-spacing visibility
    border-right line-height visited
    border-right-color link white-space
    border-right-style list-style width
    border-right-width list-style-image word-spacing
    border-style list-style-position z-index
    border-top list-style-type  
    border-top-color margin  

General Rules

  1. Use display items inside EHTML; if you use binary data items the data displayed on the form is not human-readable.
  2. Reference modification on substitution markers is allowed. See Example 3.

Example 1, Unqualified substitution marker

 working-storage section.
 01 acct-code    pic 9(8).
 ...
 procedure division.
 ...
*> First colon is followed by a space, so it is
*> not treated as a substitution marker by
*> EXEC HTML. Second colon is followed by a
*> data-name, so it is treated as a
*> substitution marker. The third colon is preceded
*> by a backslash, so it is treated as a colon
     EXEC HTML
         Account Code: :acct-code <BR>
         \:acct-code
     END-EXEC

Example 2, Qualified substitution marker

 working-storage section.
 01 customer.
   03 name         pic x(80).
   03 acct-code    pic 9(8).
 ...
 procedure division.
 ...
*> customer.acct-code equivalent inside EXEC HTML
*> block to acct-code of customer in COBOL source.
     EXEC HTML
         Account Code: :customer.acct-code <BR>
     END-EXEC

Example 3, Substitution marker with reference modification

 working-storage section.
 01 acct-code    pic 9(8).
 ...
 procedure division.
 ...
*> Reference modification outputs first four characters of
*> acct-code.
     EXEC HTML
         Account Code: :acct-code(1:4) <BR>
     END-EXEC
Previous Topic Next topic Print topic