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 Problem reading GTF trace output danik56 ABENDS & Debugging 7 Thu Mar 16, 2017 1:02 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts How to get current date -1 and curren... murali.andaluri DFSORT/ICETOOL 3 Wed Mar 08, 2017 2:09 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm


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