Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
What 'INITIALIZE' statement in cobol do

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: What 'INITIALIZE' statement in cobol do
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    Post subject:
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: 1190
Location: Bangalore,India

PostPosted: Thu Feb 22, 2007 12:14 pm    Post subject:
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: 2360
Location: Israel

PostPosted: Thu Feb 22, 2007 2:12 pm    Post subject:
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    Post subject:
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    Post subject: Re: What 'INITIALIZE' statement in cobol do
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Linkage editor is part of COBOL, z/OS... ankit.jain COBOL Programming 4 Fri Apr 20, 2018 4:17 pm
This topic is locked: you cannot edit posts or make replies. Difference between EQUAL and EQUAL TO... jithinraghavan COBOL Programming 3 Thu Apr 19, 2018 2:22 am
No new posts Call COBOL or PLI with a click from w... vaibhav gs All Other Mainframe Topics 1 Mon Apr 16, 2018 7:29 pm
No new posts COBOL MVS options BiswajitDG COBOL Programming 8 Fri Apr 06, 2018 12:35 am
No new posts batch cobol/db2 paragraph fall thru a... alois eisshofer COBOL Programming 5 Wed Mar 14, 2018 12:21 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us