×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

COBOL General discussion FAQ

COBOL Weblers

How can I put fonts in my PC COBOL reports by CliveC
Posted: 7 Dec 03

Basically just inject HTML tags into the output stream and use .HTM as a file extension.

In this example a name is accepted from the command line and a certificate is output to a file named certify.htm.

       IDENTIFICATION DIVISION.
       PROGRAM-ID.    CERTIFY.
       AUTHOR.        CLIVE CUMMINS.
       INSTALLATION.  http://tubularity.com
       DATE-WRITTEN.  DEC  7,2003.

       ENVIRONMENT DIVISION.
       INPUT-OUTPUT SECTION.
       SELECT OUTPUT-FILE ASSIGN TO OUTPUT-FILE-ID
              FILE STATUS  IS OUTPUT-RETURN-CODE
              ACCESS MODE  IS SEQUENTIAL
              ORGANIZATION IS LINE SEQUENTIAL.

       DATA DIVISION.
       FILE SECTION.
       FD  OUTPUT-FILE.
       01  OUTPUT-RECORD     PIC X(72).
       WORKING-STORAGE SECTION.
       01 OUTPUT-PARAMETERS.
       02 OUTPUT-RETURN-CODE PIC X(02).
       02 OUTPUT-FILE-ID     PIC X(12).
       01 CERT-TBL.
       02 FILLER PIC X(36) VALUE "<html><head><title>COBOL Webler Cert".
       02 FILLER PIC X(36) VALUE "ification</title>                   ".
       02 FILLER PIC X(36) VALUE "<style type='text/css'>             ".
       02 FILLER PIC X(36) VALUE "                                    ".
       02 FILLER PIC X(36) VALUE "h2 {font-family: 'Monotype Corsiva',".
       02 FILLER PIC X(36) VALUE "'Brush Script MT','cursive'}        ".
       02 FILLER PIC X(36) VALUE "</style></head><body><div align='cen".
       02 FILLER PIC X(36) VALUE "ter'><br /><br />                   ".
       02 FILLER PIC X(36) VALUE "<h1>This is to Certify that</h1><u><".
       02 FILLER PIC X(36) VALUE "h2>                                 ".
       02 C-NAME PIC X(72) VALUE "Your Name                           ".
       02 FILLER PIC X(36) VALUE "</h2></u><h3>has acheived the status".
       02 FILLER PIC X(36) VALUE " of Master COBOL Webler</h3>        ".
       02 FILLER PIC X(36) VALUE "</div></body></html>                ".
       02 FILLER PIC X(36) VALUE "                                    ".
       01 FILLER REDEFINES CERT-TBL.
       02 CERT-TBL-ENTRY PIC X(72) OCCURS 008 INDEXED BY CERT-TBL-IDX.

       PROCEDURE DIVISION.
           ACCEPT C-NAME FROM COMMAND-LINE.
           MOVE "certify.htm" TO OUTPUT-FILE-ID.
           OPEN OUTPUT OUTPUT-FILE.
           PERFORM
             VARYING CERT-TBL-IDX FROM 1 BY 1
               UNTIL CERT-TBL-IDX GREATER THAN 8
             MOVE CERT-TBL-ENTRY (CERT-TBL-IDX) TO OUTPUT-RECORD
             WRITE OUTPUT-RECORD
           END-PERFORM.
           CLOSE OUTPUT-FILE.
           GOBACK.

Back to COBOL General discussion FAQ Index
Back to COBOL General discussion Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close