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: 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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts ALPHABETIC check in COBOL vidyaa COBOL Programming 8 Thu Aug 17, 2017 7:13 pm

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