## sign stored in Packed Decimal fields and Zoned Decimal field

cobol interview questions

Moderator: Moderator Group

Krishna
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am

### sign stored in Packed Decimal fields and Zoned Decimal field

How is sign stored in Packed Decimal fields and Zoned Decimal fields?

Krishna
Posts: 1052
Joined: Fri Jan 27, 2006 7:50 am
Packed Decimal fields: Sign is stored as a hex value in the last nibble (4 bits ) of the storage.

Zoned Decimal fields: As a default, sign is over punched with the numeric value stored in the last bite.

sambit_mech
Member
Posts: 9
Joined: Wed Jul 14, 2010 11:17 am
Location: India
Packed decimal:
Signed numeric -
+1234 ---> in hex

024
13C

-1234 ---> in hex

024
13D

Unsigned numeric -

1234 ---> in hex

024
13F

Zoned Decimal:

Signed numeric -
+1234 ---> 123D in EBCDIC
-1234 ---> 123M in EBCDIC

Unsigned numeric -
1234 ---> 1234 in EBCDIC

How the sign is punched?
} -0
{ 0
A 1
B 2
C 3
D 4
E 5
F 6
G 7
H 8
I 9
J -1
K -2
L -3
M -4
N -5
O -6
P -7
Q -8
R -9
"By failiing to prepare, you are preparing to fail." - Benjamin Franklin

# FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
• JCL Tutorial
Covers all important JCL concepts.
• Cobol Tutorial
This tutorials covers all Cobol Topics from STRING to COMP-3.
• DB2 Tutorial
DB2 Tutorial focuses on DB2 COBOL Programming.
• SORT Tutorial
This Tutorial covers all important aspects of DFSORT with examples
• CICS Tutorial
This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions

Other References
Mainframe Tools and others