IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

What 'INITIALIZE' statement in cobol do


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
DeepaBala

New User


Joined: 20 Feb 2007
Posts: 13
Location: Trivandrum

PostPosted: Thu Feb 22, 2007 10:49 am
Reply with quote

Hi friends,

What is the statement INITIALIZE do in cobol?
plz give some Example too
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Thu Feb 22, 2007 11:32 am
Reply with quote

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
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1208
Location: Bangalore,India

PostPosted: Thu Feb 22, 2007 12:14 pm
Reply with quote

Hi DeepaBala,

Please search the forum befor posting new thread
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Feb 22, 2007 2:12 pm
Reply with quote

... or simply read the fine manual.

O.
Back to top
View user's profile Send private message
DeepaBala

New User


Joined: 20 Feb 2007
Posts: 13
Location: Trivandrum

PostPosted: Thu Feb 22, 2007 2:20 pm
Reply with quote

Thank u. K i follow that
Back to top
View user's profile Send private message
sachin_star3
Warnings : 1

New User


Joined: 30 Sep 2006
Posts: 78
Location: pune

PostPosted: Thu Feb 22, 2007 3:40 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 2
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top