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

Cobol Intialize verb


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

New User


Joined: 19 Sep 2005
Posts: 13

PostPosted: Fri Jan 20, 2006 3:49 pm
Reply with quote

[b]Hi,

Please give solution for this question.

In my COBOL program i have declared the working storage section as follows:

working-storage section.
01 A.
02 B PIC X(10).
02 C PIC 9(4) VALUE 1234.
PROCEDURE DIVISION.
PARA1.
INTIALIZE A.

My question is:

what will be the values of B & C?


Thanks in advance

vodeti
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Fri Jan 20, 2006 4:04 pm
Reply with quote

Vodeti...

Please refer manuals... for a better understanding of the statement...

B & C would be intialized to SPACES and ZEROES respectively.

Regards,

priyesh.
Back to top
View user's profile Send private message
pa1chandak
Currently Banned

New User


Joined: 31 Jan 2006
Posts: 55

PostPosted: Thu Feb 02, 2006 1:22 pm
Reply with quote

INITIALIZE WILL MOVE ZERO'S TO NUMERIC AND NUMERIC EDITED FIELDS.

AND SPACES TO ALPHABETIC AND ALPHABETIC EDITED FIELDS.

SO B WILL HAVE SPACES AND
C WILL HAVE ZERO'S

INITIALIZE WILL NOT WORK IN THREE CASES
1. FILLERS
2. DEPENDING ON
3. OCCURS
IF I AM WRONG SOMEWHERE PLEASE CORRECT ME

THANK YOU

DO SEND ME THE REPLY

PAWAN

09822546416

// THE ONE I LOVE , I SHALL NEVER BLAME //
Back to top
View user's profile Send private message
bhoja

New User


Joined: 31 Jan 2006
Posts: 49

PostPosted: Fri Feb 03, 2006 3:24 pm
Reply with quote

what is the main use of initialize verb

Thanks
bhoj
Back to top
View user's profile Send private message
Aji

New User


Joined: 03 Feb 2006
Posts: 53
Location: Mumbai

PostPosted: Fri Feb 03, 2006 3:34 pm
Reply with quote

Hi

Initialize will move spaces to b and zeros to c.

Regards

Aji Cherian
Back to top
View user's profile Send private message
Rupesh.Kothari

Member of the Month


Joined: 27 Apr 2005
Posts: 463

PostPosted: Fri Feb 03, 2006 4:08 pm
Reply with quote

HI,

Quote:
what is the main use of initialize verb

INITIALIZE moves spaces to alphabetic fields and zeros to alphanumeric fields

Hope this helps

Regards
Rupesh
Back to top
View user's profile Send private message
mijanurit
Currently Banned

New User


Joined: 26 Aug 2005
Posts: 33
Location: bangalore

PostPosted: Mon Feb 06, 2006 4:30 pm
Reply with quote

hi!

B's value will be 10 spaces and C's value will be 4 zeros.

regards
mijanurit
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 3
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