View previous topic :: View next topic
|
Author |
Message |
DeepaBala
New User
Joined: 20 Feb 2007 Posts: 13 Location: Trivandrum
|
|
|
|
Hi friends,
What is the statement INITIALIZE do in cobol?
plz give some Example too |
|
Back to top |
|
|
prav_06 Warnings : 1 Active User
Joined: 13 Dec 2005 Posts: 154 Location: The Netherlands
|
|
|
|
Deepbala,
INITIALIZE st. moves zeros to Numeric fields and moves spaces to albhabetic and alphanumeric items, its just used to initialize the variables and assign their default values.
Code: |
e.g ..a pic 9(2).
b pic x(4).
COMPUTE a = 59.
MOVE 'LOVE' to b.
DISPLAY a.
DISPLAY b.
INITIALIZE a.
INITIALIZE b.
DISPLAY a.
DISPLAY b.
STOP run. |
O/P
A=59
b=love
A=00
B=
Thamilzan. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi DeepaBala,
Please search the forum befor posting new thread |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
Back to top |
|
|
DeepaBala
New User
Joined: 20 Feb 2007 Posts: 13 Location: Trivandrum
|
|
|
|
Thank u. K i follow that |
|
Back to top |
|
|
sachin_star3 Warnings : 1 New User
Joined: 30 Sep 2006 Posts: 78 Location: pune
|
|
|
|
initialize statement is for
initialize the value for alphanumeris and alphabetis items
ie. initialize move the zero to numeric items
and spaces to alphabetic and alphanumeric
thank you
correct me i am wronge
-sachin borase
ibm pune |
|
Back to top |
|
|
|