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
No comments:
Post a Comment