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
 

 

advantage of packed-decimal

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
sungang77

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Tue Nov 22, 2005 12:00 pm    Post subject: advantage of packed-decimal
Reply with quote

Code:
01  PAY-RECORD.
   05  PAY-ID       PIC X(9).
   05  PAY-CLASS    PIC X(3).
   05  PAY-HRS      PIC S9(3)V9  PACKED-DECIMAL.
   05  PAY-AMT      PIC S9(7)V99 PACKED-DECIMAL.

Question:Referring to the above example, what one advantage does PACKED-DECIMAL have over BINARY?
Choice 1
PAY-RECORD is smaller than if it used BINARY fields.
Choice 2
PACKED-DECIMAL fields use less storage.
Choice 3
PACKED-DECIMAL arithmetic has greater precision.
Choice 4
PACKED-DECIMAL instructions execute faster.
Choice 5
Digits and signs are verified for each PACKED-DECIMAL operation.
Back to top
View user's profile Send private message

khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Nov 22, 2005 12:47 pm    Post subject: Packed Decimal
Reply with quote

hi frnd,


kindly refer the below link for ur solution..


http://www.discinterchange.com/TechTalk_Packed_fields_.html
Back to top
View user's profile Send private message
sungang77

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Tue Nov 22, 2005 1:34 pm    Post subject: Re: Packed Decimal
Reply with quote

khamarutheen wrote:
hi frnd,


kindly refer the below link for ur solution..


http://www.discinterchange.com/TechTalk_Packed_fields_.html


Thanks khamarutheen.
I've read the article.
There is no obvious answer to the question.
In another URL
http://www.discinterchange.com/TechTalk_BCD_binary_.html
I get to know that choice 2 is wrong.
But I still not sure 1 or 3 is correct.
The choice 4 must be wrong, because the binary execute the fastest.
The choice 5 is also wrong.
The choice 1, if COMP-3, PAY-RECORD is 9+3+5+10=27;
if BINARY, PAY-RECORD is 9+3+3+6=21.
so choice 1 should be right.
the choice 3, I remember that I ever read that PACKED-DECIMAL has more precision.
So...I am not very confirm whether the answer should be 1 or 3.
Back to top
View user's profile Send private message
khamarutheen

Active Member


Joined: 23 Aug 2005
Posts: 680
Location: NJ

PostPosted: Tue Nov 22, 2005 2:06 pm    Post subject: Packed Decimal
Reply with quote

hi frnd,

Choice 3: PACKED-DECIMAL arithmetic has greater precision.
my doubt is arithmetic precision inclues (,),+,/,*,- also.. so may be the choice 3 right.. let us make clear the answer and again let us discuss..
Back to top
View user's profile Send private message
sungang77

New User


Joined: 03 Nov 2005
Posts: 46
Location: Shanghai, China

PostPosted: Tue Nov 22, 2005 2:26 pm    Post subject:
Reply with quote

OK khamarutheen.
Thank you~~~
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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am
No new posts Convert Decimal to hexadecimal Steve Ironmonger DFSORT/ICETOOL 5 Fri May 27, 2016 4:19 pm
This topic is locked: you cannot edit posts or make replies. JCL to convert float decimal into rea... polymathtarun JCL & VSAM 3 Sun May 15, 2016 9:57 pm
No new posts conversion from char to packed decimal Musab Ahmed DFSORT/ICETOOL 7 Fri Apr 08, 2016 1:12 pm
No new posts NDM Packed Data file from Mainframes ... santhosh5983 IBM Tools 2 Wed Mar 30, 2016 2:36 am


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