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 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 it is possible output a SET value fro... Martylin JCL & VSAM 4 Fri Sep 22, 2017 7:08 am
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Hardcoded negative sign value in output scdinesh SYNCSORT 8 Fri Sep 08, 2017 5:28 am
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm

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