• Image 1
  • Image 2
  • Image 3
  • Image 4
  • Image 5
  • Image 6
  • Image 7




Tuesday, June 19, 2012

COBOL PROCEDURE - TUTORIAL FOR NEWBIE


Hi... Now You at Site WE ARE KNOWLEDGE... Having Knowledge in here... Let's Read it...

This time I want giving you tutorial about COBOL programing...
COBOL Is common bussiness oriental language...

In programing COBOL little different with other program... Because COBOL program not have compiller.. In compiller helped other aplication...
And this time, I want introduction using "PROCEDUR"....

In use PROCEDURE many avail like as :
  1. Economical code
  2. Can using to continue


Ok...dirrect to use.... firstly you must open notepad or other for make program. If program code done you must saving in folder same with place installer COBOL program..

1. Open CMD with method...

press icon windows + R... and write CMD >> ENTER
OR
click start >> Run.. and write CMD >> ENTER




2. In here you must understand using CD, CD...

CD.. for back to folder
cd program files\cobol for enter in COBOL program
edit for enter in make code... You can using this for make code
ussually likely "edit (spasi) namefile.cob... avail when we want saving just click save And not write name file again....

Or if you not understand, using notepad, but you must saving in same place with program


You can copy paste this program code in your program
If difficult for paste.. right click blue colour in header (file, view,  edit) and choice edit >> paste...

       IDENTIFICATION DIVISION.
       PROGRAM-ID. PROCEDURE.
       AUTHOR. MY KNOWLEDGE.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 DATABOOK.
           02 NAMEBOOK PIC A(20).
           02 COST PIC 9(6) VALUE 0.
           02 QUANTITY PIC 9(2) VALUE 0.
           02 TOTAL PIC 9(6) VALUE 0.
       SCREEN SECTION.       
       01 CLEANING.
           02 BLANK SCREEN.
       01 ENTERING.
           02 LINE 5 COLUMN 3 VALUE 'NAME OF BOOK : '.
           02 COLUMN PLUS 1 PIC A(20) TO NAMEBOOK.
           02 LINE 7 COLUMN 3 VALUE 'COST         : '.
           02 COLUMN PLUS 1 PIC 9(6) TO COST.
           02 LINE 9 COLUMN 3 VALUE 'QUANTITY     : '.
           02 COLUMN PLUS 1 PIC 9(3) TO QUANTITY.
       01 VIEWING.
           02 LINE 13 COLUMN 3 VALUE 'TOTAL : '.
           02 COLUMN PLUS 1 PIC 9(6) FROM TOTAL.
       PROCEDURE DIVISION.
       GOING.
           DISPLAY CLEANING.
           DISPLAY ENTERING.
           ACCEPT ENTERING.
           COMPUTE TOTAL = QUANTITY * COST.
           DISPLAY VIEWING.
       STOPING.
           STOP RUN.

And result :



If done you must compille before execution program
before, you must save it in place same with Cobol program...
And exit...
  
For compille write "COBOL namefile.cob >> enter"
and look if have wrong, you must repair this program.... If noting you can execution...

Little LOGIKA:
LINE 5 COLUMN 3 mean text "NAME OF BOOK" in position line 5 and column 3....
In CObol you must using "COMPUTE" for operator...

And for execution...
"RUNCOB namefile.cob"

if your input data is : "web development", "20000", "13".


Ok,,, just it... Maybe can help you...
Thanks was visit in my page...
Thanks a lot 





No comments:

Post a Comment