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

advantage of packed-decimal


IBM Mainframe Forums -> Mainframe Interview Questions
Post new topic   Reply to topic
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
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: 677
Location: NJ

PostPosted: Tue Nov 22, 2005 12:47 pm
Reply with quote

hi frnd,


kindly refer the below link for ur solution..


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
Reply with quote

khamarutheen wrote:
hi frnd,


kindly refer the below link for ur solution..


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: 677
Location: NJ

PostPosted: Tue Nov 22, 2005 2:06 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> Mainframe Interview Questions

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
No new posts Need Help with Packed Decimal Signs DFSORT/ICETOOL 4
No new posts Select a DB2 value in a specific deci... DB2 4
Search our Forums:

Back to Top