Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 9405

PL/I & Assembler :: RE: Incorrect output when trying to add numbers

$
0
0
Author: Garry Carroll
Posted: Fri Jan 13, 2017 5:34 pm (GMT 5.5)

You are seeing 06E because the sum is a positive number. The packed number is x'065C' which unpacks as C'6E', because X'C5' whicnis the last byte unpacked is the letter 'E'.

What you need to do, after the
Code:
FINISH UNPK OUTNUM,TOTAL
instruction is to make the last digit printable as a number. This is achieved by adding the instruction
Code:
       OI  UNPACK+1, X'F0' 
after the UNPK.

Garry
_________________
Everyone's entitled to ONE fatal mistake.....


Viewing all articles
Browse latest Browse all 9405

Trending Articles