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




Showing posts with label COBOL. Show all posts
Showing posts with label COBOL. Show all posts

Tuesday, September 11, 2012

SAMPLE LIABRARY PROGRAM USING COBOL

Hi IT knowledge lovers you are on my blog at “We Are Knowledge”.. in here you will getting many IT knowledge, from desktop programming until web programming.. I was provided you it.. and you will take FREE..

Now.. I want giving you tutorial about “COBOL” and discussof “making library program”. This is sample eazy making library program at program language cobol… you will know ?? let’s do read my article… have fun friend to read my article…

Previosly you must having the cobol program likely “cobol software”. And for more easely you can copy this coding to your notepad.


Example : :

       IDENTIFICATION DIVISION.
       PROGRAM-ID. LIBRARY PROGRAM.
       AUTHOR. MY KNOWLEDGE.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 INPUTING.
              02 X PIC 999.
              02 NM PIC A(20).
              02 JB PIC A(20).
              02 PB PIC 9(4).
              02 LP PIC 9(4).
              02 TB PIC 9(6).
       SCREEN SECTION.
       01 CLEANING.
              02 BLANK SCREEN.
       PROCEDURE DIVISION.
       GOING.
              DISPLAY CLEANING.
              DISPLAY " ".
              DISPLAY "        WELCOME TO MY PROGRAM".
              DISPLAY "       THIS IS LIBRARY PROGRAM".
              DISPLAY "THIS IS PROGRAM FOR CALCULATING PAYMENTS".
              DISPLAY "              BY - WAK".
              DISPLAY "INPUT NAME                                                       : ".
              ACCEPT NM.
              DISPLAY "INPUT TITLES             : ".
              ACCEPT JB.
              DISPLAY "INPUT COUNT OF BOOKS     : ".
              ACCEPT PB.
             DISPLAY "INPUT OLD BOOK BORROWING : ".
             ACCEPT LP.
             COMPUTE TB = LP * 500.
             DISPLAY "YOU MUST PAY             : Rp. ".
             DISPLAY TB.
       STOPING.
           STOP RUN.


Note ::

If you using copy and paste, please for change all quotes (‘ ‘) or this to (“ “)
You must change save type become “.cob” ex : library.cob.
You must follow line, 8(eight), 12(twelve).
Command alt  + F9 for compile the program
Command ctrl + F9 for running the program


Logic ::

Identification division
>> to fill author for name of programmers and program id for name of program

Environment division
>> for mechine

Working-storage division
>> for declaration variables

Procedure division
>> place for making program coding


Ok.. just it..
I hope you likely..
See you later friends…

Sunday, September 2, 2012

COBOL - SYNTAX-SYNTAX ON SEQUENTIAL FILE


Hello my friends IT knowledge lover. You are on my blog at “We Are Knowledge”.in here you will getting many IT knowledge and general knowledge. In this blog to be found IT knowledge from “Web programming” like as : HTML, PHP, JAVASCRIPT until “Dekstop programing” like as : cobol, visual basic 6, c++. And in here you also can find article about graphic design using “Adobe Photoshop”..

Like this article discuss about COBOL. You know program language COBOL ? if you do not know, let’s do read my article.. and topic of our discussion this time is “SYNTAX-SYNTAX 
ON SEQUENTIAL FILE”. You will know ??? C’ mon to read this article… have fun for read it friends..

In COBOL to be found “division”, that is ::

1. Identification Division
2. Environment Division
3. Data Division
4. Procedure Division

But for SEQUENTIAL FILE just discuss point 2 (two) until 4 (four)..


1. ENVIRONMENT DIVISION

Example ::

INPUT-OUTPUT SECTION.
FILE-CONTROL
SELECT name_of_file ASSIGN TO { DISK PRINTER }
[ORGANIZATION IS [LINE] SEQUENTIAL]
ACCESS MODE IS SEQUENTIAL.
FILE STATUS IS name_of_data.

Logic ::

SELECT
>> You should write this first

ASSIGN
>> choose the form of files that will be used, disk or print files.

FILE STATUS
>> This syntax is used to indicate (to know) the type of error that occurred


2. DATA DIVISION

In syntax on data division the equation, ie :

LABEL RECORD IS OMMITED == LABEL RECORDS ARE OMMITED
LABEL RECORD IS STANDARD == LABEL RECORDS ARE STANDARD


LABEL RECORD IS OMMITED
>> This syntax is used to print files that do not have a label

LABEL RECORD IS STANDARD
>> This syntax is used to print a file that has the label


3. PROCEDURE DIVISION

OPEN
>> this syntax for openning your file to be accessed.

CLOSE
>> this syntax for clossing your file which has been used, because if you not close, possibility your file be broken

WRITE
>> use this syntax if you want to display the output to a printer or to record data to a file that you designated.

REWRITE
>> This syntax is used to re-record the files you've recorded earlier

READ
>> this syntax used for reading in your file


Ok. just it..
I hope you like..
see you later friends...

Saturday, September 1, 2012

COBOL MOVE - TUTORIAL FOR NEWBIE


Hello my friends.. you are o my blog at “We Are Knowledge”.. Im here you will taken many IT knowledge… from Web programming until dekstop programming, you are will obtain it..

Likely this article discuss about “program language COBOL”. In here I was making you tutorial about “MOVE on cobol”. Move on COBOL likely preform or go to on COBOL. You will know ?? let’s do read this article.. Have fun my friend to read.

You can copy this program
  
Example 1 :

       IDENTIFICATION DIVISION.
       PROGRAM-ID. MOVE.
       AUTHOR. WAK.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 DMY.
           02 D PIC 99.
           02 M PIC 99.
           02 Y PIC 99.
       01 DN.
           02 D PIC 99.
           02 FILLER PIC X VALUE "-".
           02 M PIC 99.
           02 FILLER PIC X VALUE "-".
           02 Y PIC 99.
       PROCEDURE DIVISION.
       MP.
           DISPLAY "WE ARE KNOWLEDGE".
DISPLAY "   GIVING YOU".
DISPLAY "MANY IT KNOWLEDGE".
DISPLAY " ".
ACCEPT DMY FROM DATE.
           MOVE CORR DMY TO DN.
           DISPLAY DN.
           DISPLAY DMY.
       E.
           STOP "PLEASE, PRESS ENTER TO EXIT FROM ME".
           STOP RUN.


Logic ::

previously making program you must enter to cmd.
And it is you can write “edit move.cob”.

Move
>> Moving data to a receiver or other statement item, so that the input Data can be manipulated to produce the output window.

>> This syntax allows the data that has not been edited (modified) are useful in presenting information (displayed in the output window).

D, M, and Y
>> it is variable for data date, month, and year.

Display
>> for printing statement to output window

Accept
>> this syntax for input the value at output window, then to process

Stop run
>> the syntax for ending or stoping the program.

Identification division.
>> program-id is name of the your program
>> author is name programmer. You can change with your name


Ok.. just it.. I hope you likely..
See yo later

Thursday, August 30, 2012

COBOL - FORM TO USING FOR NEWBIE

 Hi.. welcome to my page at “We Are Knowledge”… in here you will getting many IT knowledge from dekstop programming until web programming.. you will getting the IT knowledge like it.. Let’s do read my article..

C’mon read this article, this article discuss about “COBOL”, and I giving tutorial of “FORM TO USING”.. ok.. direct to go..

Definition :

Form
>> This command is used to display / receive data from a variable.

To
>> This command is used to enter the value / value store the variables.

Using
>> This command is used to substitute and TO FORM command means the command can do two things above.


Ok.. now I want making program using “FORM TO USING” for you, you can copy this :

1. open cmd, method :
            a. press icon windows + R >> write “cmd” >> enter
            b. click start >> Run >> write “cmd” >> enter

2. if you put the instalation of cobol in “program files”, follow this :
            a. cd..
            b. cd..
            c. cd program files/cobol
            d. edit ftu.cob

3. copy paste this coding, you must follow the line ::

LINE ::
8    12 

IDENTIFICATION DIVISION.
       PROGRAM-ID. FEE.
       AUTHOR. W-A-K.
       ENVIRONMENT DIVISION.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       01 DM.
           02 BRG PIC A(25).
           02 HRG PIC 9(6) VALUE 0.
           02 JL PIC 9(3) VALUE 0.
           02 TOT PIC 9(6) VALUE 0.
       SCREEN SECTION.
       01 HL.
           02 BLANK SCREEN.
       01 LM.
           02 LINE 6 COLUMN 3 VALUE 'NAME OF GOODS : '.
           02 COLUMN PLUS 1 PIC A(20) TO BRG.
           02 LINE 8 COLUMN 3 VALUE 'HARGA : '.
           02 COLUMN PLUS 1 PIC 9(6) TO HRG.
           02 LINE 10 COLUMN 3 VALUE 'QUANTITY : '.
           02 COLUMN PLUS 1 PIC 9(3) TO JL.
       01 LT.
           02 LINE 14 COLUMN 3 VALUE 'TOTAL : '.
           02 COLUMN PLUS 1 PIC 9(6) FROM TOTAL.
       PROCEDURE DIVISION.
       STR.
           DISPLAY HL.
           DISPLAY LM.
           ACCEPT LM.
           COMPUTE TOT = JL * HRG.
           DISPLAY LT.
       INT.
           STOP RUN.


And if t is.. save with name “wak”.. and you must exit
Compile your program with write >> cobol wak.cob
Running your program with write >> runcob wak.cob


Ok.. just it…
I hope you likely…
See you later brother…

SAMPLE TABLE PROGRAM USING COBOL


Hi.. welcome to my site in “We Are Knowledge”… In here you will getting many IT knowledge like as : Web programming, dekstop programming, and general IT knowledge… If you will getting it, you mustreading my article…

Likelythis article.. I discuss about dekstop programming, that is program language “cobol”. Previosly I was giving tutorial about “TABLE in cobol” but I not giving sample program about it.. So.. in this article.. I want giving you “SIMPLE PROGRAM TABLE in PASCAL”.. you will know ?? let’s do read my article.. have fun and enjoy id…

For making program you must enter to directory of cobol through “CMD”.. and this method…

1. press icon windows + R >> write “cmd” >> enter
2. cobol program if you put on the “program file”, then you must do
                a.CD..
                b.CD..
                c. CD program files/cobol
                d. EDIT table.cob
3. And you have been entered in the manufacture of coding.


You can copy this coding !!

Line
     8 12  14

copy from here..

IDENTIFICATION DIVISION.
       PROGRAM-ID. tabel.
       AUTHOR. Wak.
       ENVIRONMENT DIVISION.
       CONFIGURATION SECTION.
       SPECIAL-NAMES.
           DECIMAL-POINT IS COMMA.
       DATA DIVISION.
       WORKING-STORAGE SECTION.
       77 n PIC 9.
       77 giveline PIC X(47) VALUE ALL '-'.
       01 tp.
           02  das OCCURS 5 TIMES.
               03  sn PIC X(25).
               03  i PIC 9(8).
       01      title-1  PIC X(20)  VALUE  ' SELLER NAME AND INCOME   '.
       01      title-2.
           02      FILLER  PIC X(2) VALUE '|'.
           02      FILL PIC X(26) VALUE '    SELLER NAME    '.
           02      FILL PIC X(2) VALUE '|'.
           02      FILL PIC X(16) VALUE ' INCOME '.
           02      FILL PIC X(2) VALUE '|'.
       01      it.
           02      FILL    PIC X(2) VALUE '|'.
           02      lns       PIC x(26).
           02      FILL    PIC X(2) VALUE '|'.
           02      lhp             PIC ZZ.ZZZ.ZZZ.ZZZBB.
           02      FILL    PIC X(2) VALUE '|'.
       SCREEN SECTION.
       01       hp.
           02      BLANK SCREEN.
       PROCEDURE DIVISION.
       main-prog.
           PERFORM pdt
           VARYING  n FROM 1 BY 1 UNTIL  n  >  5
           PERFORM ttp
           VARYING n FROM 1 BY 1 UNTIL  n  >  5.
           STOP RUN.
       pdt.
            DISPLAY (  ,  )  n,  '. SELLER NAME  :  '.
            ACCEPT (  ,  )  sn (n).
            DISPLAY SPACE.
            DISPLAY (  ,  )  SPACE,  ' INCOME  :  '.
            ACCEPT (  ,  ) i (n).
            DISPLAY SPACE.
       ttp.
            DISPLAY hp.
            DISPLAY title-1.
            DISPLAY giveline.
            DISPLAY title-2.
            DISPLAY giveline.
            PERFORM  tit
            VARYING  n  FROM  1  BY  1  UNTIL  n  >  5.
            DISPLAY giveline.
       tit.
            MOVE sn (n)  TO  lns.
            MOVE i (n)  TO  lhp.
            DISPLAY it.


And it is save the program…

For compile >> cobol table.cob
For running >> runcob table.cob


Note ::

if you using copy paste.. please change all quotes (“ “) or (‘ ‘)
You must followed spaced every coding..


Ok.. just it..
I hope you can do it…
Thank for you…
See you later

Tuesday, August 28, 2012

COBOL PICTURE EDITING AND CLAUSE - TUTORIAL FOR NEWBIE


Hello my friend IT program lover… You are on my blog at “We Are Knowledge”.. If you reading my article You will getting many IT knowledge in here. Likely this article.. this article discuss about “COBOL”. And tutorial about “Picture Clause Dan Editing”.

To be found between Picture Clause Dan Editing.

Picture Clause

>> Useful for determining what data types to use for variables, but this command
can also be used to display or print the form data in the output window


Editing

>> This command is used to change the shape of the data results using picture clause to be printed to the output window, to make it easier to read and more comfortable seeing.


1. Picture Clause


a. Picture character 9
>> used to store or produce data in the form of numerical

Ex :
number PIC 99999.
number PIC 9(5).


b. Picture character A
>> used to store or produce data in the form of the

Ex :
            Name PIC aaaaa.
            Name PIC a(5).


c. Picture character X
>> used to store or produce data in the form of numeric and alphabet

Ex :
            Address PIC x(20)


d. Picture character V
>> for decimal numbers, and can only be used in conjunction with a picture clause 9

Ex :
price PIC 9999V99.             >> 234.50
price PIC 9(5)V9(3). >>     4656.345


e. Picture character P
>> this picture character for to appear value “0”

Ex :
            price PIC 9PPV.  >> 900.


f. Picture character S
>> the picture character using for giving minus sign (-)


1. Picture Editing

a. Picture editing karakter Z.
>> omit the 0 at the front


b. Picture editing karakter $.
>> giving “$” sign


c. Picture editing karakter (.) and (,).
>> giving stops and commas


d. Picture editing karakter “-“.
>> giving minus sign


e. Picture editing karakter “+”.
>> giving minus sign, if the value is positif not giving positif sign


f. Picture editing karakter DB and CR.
>> commonly used to model accounting


g. Picture editing karakter “B”.
>> operator inserts blank where "B" is located


h. Picture editing karakter “*”.
>> this picture editing for change “0” with “*” sign


i. Picture editing karakter “0”.
>> insert the character 0 (zero)


j. Picture editing karakter “/”.
>> insert character /, commonly used for date or time


Ok..just it..
I hope you understand..
See you later

COBOL LEVEL NUMBER - TUTORIAL FOR NEWBIE


Hi.. hi.. hi.. Welcome to my blog, you are on my blog at “We Are Knowledge”. In here you will getting many IT knowledge. I was provided you IT knowledge from dekstop programming until web programming. Moreover I also provided IT knowledge about graphic design using “ADOBE PHOTOSHOP”. You can find it here.

But now.. I want giving you IT knowledge about program language “COBOL”. Previosuly You know about the this program language ? you will know ?? let’s do read my article… you want getting your questions… Ok.. have fun and enjoy to read my article…

COBOL is program language based dekstop programming, likely pascal, C++, VB 6. But there is a very noticeable difference with the programming language pascal, c + +, vb 6, which is the programming language compiler cobol he lacks himself, so he needs help to compile the coding.

My discussion this time is the level number in cobol. level number in cobol is is a number that describes levels of data items in a record. The greater the number (level) level, the lower the level of degree.

There are five levels and this number is the level number in cobol :

Level Number 01

>> This is a description of a record


Level Number 02-49

>> This number level to initiate the description of the data item

Example :

Data Division.
Working-Storage Section.
01   input-of-data.
02   Name Pic A(10).
02   Number.
                        03 hp-numbers Pic 9(6).
          03 house-numbers pic 9(6).
          03 office-numbers pic 9(6).
            02  total-revenue Pic 9(7).


Level Number 66

>> Renames

Example :

01 Input-of-data.
02 Name                     Pic A(10).
02 sex                         Pic A(10).
02 address                   Pic X(20).
02 no_hp                     Pic X(15).

66 Data-Student Renames Name thru address.


Level Number 77

>> This number level to initiate an independent data item


Level Number 88

>> This number level we can use the condition

Example:

Data Division.
Working-Storage Section.
01  Data-Masukkan.
            02 quetions Pic A.
                        88 try_again value is ‘Y’, ‘y’.
                        88 enough    value is ‘T’, ‘t’.
77  Name Pic A(20).


Ok.. just it..
I hope you understand..
See you later..