**************************************
      *             TCP/IP                 *
      *          DATA STRUCTURES           *
      **************************************
      * TCP/IP RETURN CODES DATA STRUCTURE *
      * DO NOT CHANGE IT.                  *
      **************************************
       01 TCPIP-RETURN-CODES.
          05 TCPIP-RETURN-CODE                          PIC 9(07).
          05 TCPIP-RETURN-MESSAGE                       PIC X(255).
      **************************************
      * USER VARIABLE DECLARATIONS         *
      **************************************
       01 WS-HOST-NAME      PIC X(80).
       01 WS-FILE-NAME      PIC X(20).
       01 WS-WEB-PAGE-NAME  PIC X(80).
       01 port_num PIC 9(04) value 8080.

       1 ws-eof PIC X(1) value `N`.
       1 x pic 999.
       1 delimiter PIC x(n) value ` `.
       1 buffer           PIC X(200).
       1 numtokens    PIC 999.
       1 tokens occurs 100 times.
         5 token pic x(n) value `0`.

       
       main.
           MOVE `yourhost.com` TO WS-HOST-NAME.
           MOVE `/` TO WS-WEB-PAGE-NAME.
           MOVE `web.txt` TO WS-FILE-NAME.
           DISPLAY `<` & WS-HOST-NAME  & `>`.
           DISPLAY `<` &  WS-WEB-PAGE-NAME  & `>`.
           DISPLAY `<` &  WS-FILE-NAME  & `>`.
           GETWEBPAGE USING WS-HOST-NAME WS-WEB-PAGE-NAME WS-FILE-NAME `N` port_num.

            fd `web.txt` record is 200 bytes.
            open `web.txt` for reading.
            read `web.txt` into buffer at end move `Y` to ws-eof.
            perform until ws-eof = `Y`
               display `record: [` & buffer & `]`
               TOKENIZE buffer numtokens tokens delimiter
               perform varying x from 1 by 1 until x > numtokens
                  DISPLAY `token(` & x & `) = [` & token(x) & `]`
               end-perform
               read `web.txt` into buffer at end move `Y` to ws-eof
            end-perform.




           display ``.
           display ``.

           DISPLAY `TCPIP-RETURN-CODES: `  & TCPIP-RETURN-CODES.
           GOBACK.