1.

What Is The Difference In Data Type "x" And "p"?

Answer»

In MVS assembler data type X denotes hexadecimal data type which unsigned pack. SUPPOSE you define VAR1 as "VAR1 DC X'01'".

It will occupy 1 byte in the memory and stored as: 

  • 0 in the zoned nibble and 1 in the numeric nibble.
  • P denotes the packed data type, similar to COMP-3 in COBOL
  • if you declare any variable with this data type then it MUST have a sign byte at last nibble. 

See following example:

VAR2 DC P'1'

it will occupy one byte in the memory and stored as '1C'.

In MVS assembler data type X denotes hexadecimal data type which unsigned pack. suppose you define VAR1 as "VAR1 DC X'01'".

It will occupy 1 byte in the memory and stored as: 

See following example:

VAR2 DC P'1'

it will occupy one byte in the memory and stored as '1C'.



Discussion

No Comment Found