****************************************
      * Program name: input.cbl
      * This program demonstrates the use of
      * the ACCEPT DATA FROM WEBPAGE command.
      *
      * Copyright 2000 Deskware, Inc.
      ****************************************                                                             
       1 content_length        PIC 9(05).
      *
       1 field1                PIC X(20).
       1 field2                PIC X(100).
       1 field3                PIC X(20).
       1 field4                PIC X(20).
       1 field5                PIC X(20).
       1 field6                PIC X(20).
       1 field7                PIC X(20).
       1 field8                PIC X(20).
       1 field9                PIC X(20).
       1 field10               PIC X(20).
       1 field11               PIC X(20).
       MAIN.
           GETENV USING `CONTENT_LENGTH` content_length.
           IF content_length IS GREATER THAN 0 THEN
              ACCEPT DATA FROM WEBPAGE
              PERFORM DISPLAY_CGI_DATA
           ELSE
              PERFORM DISPLAY_WEB_PAGE
           END-IF.
           GOBACK.
       DISPLAY_WEB_PAGE.
           DISPLAYLF `Content-type: text/html`.
           DISPLAYLF LINEFEED.
           DISPLAYLF ``.
           DISPLAYLF `
CobolScript Data Input Example Application

`. DISPLAYLF `
`. DISPLAYLF `field1: `. DISPLAYLF `

`. DISPLAYLF `field2: `. DISPLAYLF `

`. DISPLAYLF `field3: `. DISPLAYLF `

`. DISPLAYLF `field4: `. DISPLAYLF `

`. DISPLAYLF `field5:
`. DISPLAYLF `Item111
`. DISPLAYLF `Item222
`. DISPLAYLF `Item333
`. DISPLAYLF `Item444
`. DISPLAYLF `Item555
`. DISPLAYLF `field6: Item1111
`. DISPLAYLF `field7: Item2222
`. DISPLAYLF `field8: Item3333
`. DISPLAYLF `field9: Item4444
`. DISPLAYLF `field10:Item5555
`. DISPLAYLF `
`. DISPLAYLF `

`. DISPLAYLF `
`. DISPLAY ``. DISPLAY_CGI_DATA. DISPLAYLF `Content-type: text/html`. DISPLAYLF LINEFEED. DISPLAYLF ``. DISPLAYLF `
CobolScript Data Input Example Application

`. DISPLAYLF `
This is the data that was entered on the previous form

`. DISPLAYLF `field1:` & field1 & `
`. DISPLAYLF `field2:` & field2 & `
`. DISPLAYLF `field3:` & field3 & `
`. DISPLAYLF `field4:` & field4 & `
`. DISPLAYLF `field5:` & field5 & `
`. DISPLAYLF `field6:` & field6 & `
`. DISPLAYLF `field7:` & field7 & `
`. DISPLAYLF `field8:` & field8 & `
`. DISPLAYLF `field9:` & field9 & `
`. DISPLAYLF `field10:` & field10 & `
`. DISPLAYLF `field11:` & field11 & `

`. DISPLAY ``.