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 will be the OUTPUT of the following code?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: What will be the OUTPUT of the following code?
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    Post subject: Re: What will be the OUTPUT of the following code?
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: 3158
Location: Tucson AZ

PostPosted: Sat Dec 16, 2006 5:46 pm    Post subject:
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    Post subject: Re: What will be the OUTPUT of the following code?
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: 3158
Location: Tucson AZ

PostPosted: Sat Dec 16, 2006 7:53 pm    Post subject: Re: What will be the OUTPUT of the following code?
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    Post subject: Re: What will be the OUTPUT of the following code?
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    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 MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 1 Tue Jan 24, 2017 1:23 pm
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 0 Thu Jan 12, 2017 12:02 pm
This topic is locked: you cannot edit posts or make replies. Calling REXX code from ISPF panel sanchita dey TSO/ISPF 4 Mon Jan 02, 2017 5:13 pm
No new posts PL/I code tuning/Performance improvement Virendra Shambharkar PL/I & Assembler 4 Mon Dec 05, 2016 11:57 am


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