Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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: 1187
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 SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts ROUNDED Problem with COMPUTE statement shalem COBOL Programming 11 Thu Feb 09, 2017 8:16 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us