Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
sungang77

New User

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

Posted: Tue Nov 22, 2005 12:00 pm    Post subject: advantage of packed-decimal

 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.

khamarutheen

Active Member

Joined: 23 Aug 2005
Posts: 680
Location: NJ

 Posted: Tue Nov 22, 2005 12:47 pm    Post subject: Packed Decimal hi frnd, kindly refer the below link for ur solution.. http://www.discinterchange.com/TechTalk_Packed_fields_.html
sungang77

New User

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

Posted: Tue Nov 22, 2005 1:34 pm    Post subject: Re: Packed Decimal

 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.
khamarutheen

Active Member

Joined: 23 Aug 2005
Posts: 680
Location: NJ

 Posted: Tue Nov 22, 2005 2:06 pm    Post subject: Packed Decimal 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..
sungang77

New User

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

 Posted: Tue Nov 22, 2005 2:26 pm    Post subject: OK khamarutheen. Thank you~~~
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics How can I convert charactor to fixed ... liying DFSORT/ICETOOL 7 Tue May 22, 2018 3:35 pm How to group and sum the decimal value sakrat DFSORT/ICETOOL 2 Tue Mar 06, 2018 9:13 pm Extend the decimal values in DIVISION Balaryan DFSORT/ICETOOL 3 Thu Oct 05, 2017 4:05 pm READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us