skip to main content

Development : Developing an hello world application from scratch : Building the COBOL program

Building the COBOL program
Using isCOBOL IDE
1.
Click on the File menu
2.
3.
Choose isCOBOL EIS Project
4.
Note - At the time this document is written Android devices don’t support Java classes whose major version number is greater than 51, so, if you’re working with JDK 1.8 or greater:
5.
Click on the Next button until you reach the page where you can set Compiler/Runtime options
6.
7.
8.
Click on the Finish button to confirm settings and complete the project creation.
Note - you will be prompted to switch to the isCOBOL HTML perspective. This switch is suggested in order to have a better view of this kind of project.
9.
Right click on the source folder and choose New
10.
Choose Source File
11.
12.
Put the COBOL code into the program and compile it
Without isCOBOL IDE
1.
2.
Put the COBOL code into the file
3.
4.
Compile the program with the command:
Note - At the time this document is written Android devices don’t support Java classes whose major version number is greater than 51, so, if you’re working with JDK 1.8 or greater, use this command instead:
5.
COBOL code
       PROGRAM-ID. hello.
       CONFIGURATION SECTION.
       REPOSITORY.
           class web-area as "com.iscobol.rts.HTTPHandler"
       WORKING-STORAGE SECTION
       01 hello-buffer identified by "_comm_buffer".
          03  filler identified by "_status".
              05 response-status pic x(2).
          03  filler identified by "_message".
              05 response-message pic x any length.
          03  filler identified by "hellotext".
              05  xml-hellotext pic x any length.
       LINKAGE SECTION.
       01  lnk-area object reference web-area.
       PROCEDURE DIVISION using lnk-area.       
           move "Operation successful" to response-message.
           move "OK" to response-status.
           move "Hello World from isCOBOL!" to xml-hellotext.
           lnk-area:>displayXML (hello-buffer).
Note - The above code takes advantage of the HTTPHandler class (com.iscobol.rts.HTTPHandler) for communicating with the HTML user interface (explained later).

Copyright (c) 2017 Veryant
Contact us
Please share your comments on this manual or on any
Veryant product documentation with the email button at the top left