Member HTMLMSG in CGICBLDEV2 / QCBLLESRC

1.00 
 ********START OF PGM : HTMLMSG  ****************************************
2.00 
       *================================================================
3.00 
       *
4.00 
       *  After compiling this module, create the program as follow:
5.00 
       *
6.00 
       *  CRTPGM  PGM(CGICBLDEV2/HTMLMSG) MODULE(CGICBLDEV2/HTMLMSG)
7.00 
       *          BNDDIR(CGICBLDEV2/CGICBLDEV2)
8.00 
       *          ACTGRP(HTMLMSG) AUT(*USE)
9.00 
       *
10.00 
       *================================================================
11.00 
        PROCESS NOXREF APOST
12.00 
        ID    DIVISION.
13.00 
        PROGRAM-ID. HTMLMSG.
14.00 
        ENVIRONMENT DIVISION.
15.00 
        CONFIGURATION SECTION.
16.00 
        SPECIAL-NAMES.
17.00 
              copy CPYSPCNAME of CGICBLDEV2-QCBLLESRC.
18.00 
        INPUT-OUTPUT SECTION.
19.00 
        FILE-CONTROL.
20.00 
       *=================================================================
21.00 
        DATA DIVISION.
22.00 
        FILE SECTION.
23.00 
       *=================================================================
24.00 
        WORKING-STORAGE SECTION.
25.00 
       *=================================================================
26.00 
        01         HTML-DATA.
27.00 
       * Variables to load external HTML
28.00 
            05     fn                  PIC  X(10) VALUE 'HTMLEXAMPL'.
29.00 
            05     lib                 PIC  X(10) VALUE 'CGICBLDEV2'.
30.00 
            05     mbr                 PIC  X(10) VALUE 'HTMLMSG'.
31.00 
       * Variable for QWrtSection procedure
32.00 
            05     HtmlSects           PIC  X(1000).
33.00 
       * Variables for HTML messages
34.00 
            05     retcode             PIC  S9(9) comp-4.
35.00 
            05     msglvl              PIC  S9(9) comp-4.
36.00 
            05     msgtxt              PIC  X(200).
37.00 
            05     msgcnt              PIC  S9(9) comp-4.
38.00 
       *=================================================================
39.00 
       *                M A I N  -  L I N E
40.00 
       *=================================================================
41.00 
        PROCEDURE DIVISION.
42.00 
        A-start-pgm.
43.00 
       * Load the external HTML
44.00 
            call 'QGETHTML' using fn lib mbr.
45.00 
       * Issue section 'top'
46.00 
            move 'top' to HtmlSects
47.00 
            call 'QWRTSECTION' using HtmlSects.
48.00 
       * Configure messages (use default values)
49.00 
            call procedure 'QCFGMSGS'.
50.00 
       * Clear messages
51.00 
            call 'QCLRMSGS'.
52.00 
       * Add level 1 message
53.00 
            move 'This is a level 1 message' to msgtxt.
54.00 
            call 'QADDMSG' using msgtxt
55.00 
                           returning into retcode.
56.00 
       * Add another level 1 message
57.00 
            move 'This is another level 1 message' to msgtxt.
58.00 
            call 'QADDMSG' using msgtxt
59.00 
                           returning into retcode.
60.00 
       * Add level 2 message
61.00 
            compute msglvl = 2.
62.00 
            move 'This is a level 2 message' to msgtxt.
63.00 
            call 'QADDMSG' using msgtxt msglvl
64.00 
                           returning into retcode.
65.00 
       * Add level 3 message
66.00 
            compute msglvl = 3.
67.00 
            move 'This is a level 3 message' to msgtxt.
68.00 
            call 'QADDMSG' using msgtxt msglvl
69.00 
                           returning into retcode.
70.00 
       * Get message count (just for fun)
71.00 
            call 'QGETMSGCNT' returning into msgcnt.
72.00 
       * Issue messages
73.00 
            call 'QWRTMSGS'.
74.00 
       * Issue section 'end'
75.00 
            move 'end' to HtmlSects.
76.00 
            call 'QWRTSECTION' using HtmlSects.
77.00 
       * Send the HTML buffer
78.00 
            move '*fini' to HtmlSects.
79.00 
            call 'QWRTSECTION' using HtmlSects.
80.00 
       *----------------------------------
81.00 
        B-end-pgm.
82.00 
            exit program and continue run unit.
83.00 
 ********* END OF PGM : HTMLMSG ****************************************
0.031 sec.s