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

What will be the OUTPUT of the following code?


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

New User


Joined: 30 Sep 2006
Posts: 19
Location: mumbai

PostPosted: Sat Dec 16, 2006 4:18 pm
Reply with quote

cONSIDER THE FOLLOWING DATA DIVISION ENTRIES:

01 Figures.
02 Fig-A PIC 99V99.
02 Fig-B Redefines Fig-A PIC 9(4)
02 Fig-C PIC 9(4)V99.

What will be the contents of Fig-C after the execution of the following statements?

Move 17.25 TO Fig-B.
Move Fig-A To Fig-C.

Options :: (a) 001725 (b) 001700 (c) 000017 (d) 172500

Please EXPLAIN your Answer.
Back to top
View user's profile Send private message
nbalajibe
Warnings : 1

New User


Joined: 28 Nov 2006
Posts: 75
Location: India

PostPosted: Sat Dec 16, 2006 4:43 pm
Reply with quote

hi,
i think the answer is the second option.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Dec 16, 2006 5:46 pm
Reply with quote

b, you are right.
Is this a test or do you just not know why?
Back to top
View user's profile Send private message
rammf
Currently Banned

New User


Joined: 24 Jul 2005
Posts: 17
Location: chennai

PostPosted: Sat Dec 16, 2006 7:40 pm
Reply with quote

Thompson,

Could u Plz explain briefly?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Sat Dec 16, 2006 7:53 pm
Reply with quote

icon_redface.gif You have a point, I do jump to conclusions too quikly sometimes....
Quote:
01 Figures.
02 Fig-A PIC 99V99.
02 Fig-B Redefines Fig-A PIC 9(4)
02 Fig-C PIC 9(4)V99.

Move 17.25 TO Fig-B.
Move Fig-A To Fig-C.

17.25 to whole number truncates to 17
9999 redefined to 99V99 puts the 17 behind the implied decimal
.17 moved to a two decimal field keeps .17
A display without editing results in "c" 000017
Thanks for the heads up icon_smile.gif
Back to top
View user's profile Send private message
rammf
Currently Banned

New User


Joined: 24 Jul 2005
Posts: 17
Location: chennai

PostPosted: Sat Dec 16, 2006 8:06 pm
Reply with quote

Cool, Thompson.

Thx for ur quick turn-around.
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 TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top