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




Monday, June 18, 2012

COBOL IF - 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 "IF"....
IF COBOL likely IF other program.... Usually in IF using to "GO TO"...

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....



You can copy paste this program code in your program


       IDENTIFICATION DIVISION.
       PROGRAM-ID. IF.
       AUTHOR. MY KNOWLEDGE.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 INPUTING.
           02 X PIC 999.
       SCREEN SECTION.
       01 CLEANING.
           02 BLANK SCREEN.
       PROCEDURE DIVISION.
       GOING.
           DISPLAY CLEANING.
           DISPLAY " ".
           DISPLAY "INPUT SCORE 1 TO 100".
           ACCEPT X.
           IF X > 89 GO TO D.
           IF X > 78 GO TO C.
           IF X > 59 GO TO B.
           IF X > 0  GO TO A.
       D.
           DISPLAY "VERY GOOD".
           GO TO STOPING.
       C.
           DISPLAY "GOOD".
           GO TO STOPING.
       B.
           DISPLAY "ENOUGH".
           GO TO STOPING.
       A.
           DISPLAY "BAD".
       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...

This execution first...
I input score is "10" and result "BAD"



I input score is "60" and result "ENAUGH"



I input score is "80" and result "GOOD"



I input score is "99" and result "VERY GOOD"




Ok just it, back to my site and found other article. Exactly article can add your knowledge...
Thanks for  you... came back in my page... Se yoooouuuuu later

No comments:

Post a Comment