HP3000-L Archives

December 2000, Week 4

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Ric Merz <[log in to unmask]>
Reply To:
Date:
Sun, 24 Dec 2000 10:31:59 -0800
Content-Type:
text/plain
Parts/Attachments:
text/plain (66 lines)
Just one minor modification:

The "MOVE ZERO TO BINARY-BYTES" must be the FIRST line code to initialize
the upper byte (the one not named) in BINARY-BYTES.

Otherwise, the resulting value that is moved to RESULT-NUMBER-2 will be a
combination of the "junk" in the upper byte along with the desired value in
the lower byte.  It only needs to be initialized once.

Ric


At 03:09 PM 12/22/2000 -0600, you wrote:
>Ron
>
>I can best describe with code:
>
>01  BINARY-NUMBER    PIC S9(4) BINARY.
>01  NOT-BINARY-NUMBER REDEFINES BINARY-NUMBER.
>     03  UPPER-BYTE    PIC X.
>     03  LOWER-BYTE PIC X.
>
>01  BINARY-BYTES   PIC S9(4) BINARY.
>01  BYTES REDEFINES BINARY-BYTES.
>      03          PIC X.
>      03   BYTE-VALUE  PIC X.
>.
>.
>MOVE NUMBER TO BINARY-NUMBER.
>MOVE UPPER-BYTE TO BYTE-VALUE.
>MOVE BINARY-BYTES TO RESULT-NUMBER-1
>MOVE ZERO TO BINARY-BYTES.
>MOVE LOWER-BYTE TO BYTE-VALUE.
>MOVE BINARY-BYTES TO RESULT-NUMBER-2.
>
>
>This works for me when needed.
>
>Bob Schlosser
>(504) 219-8134
>Ochsner Health Plan
>
> -----Original Message-----
>From: [log in to unmask]
>Sent: Friday, December 22, 2000 2:41 PM
>To: [log in to unmask]
>Subject: Splitting numeric fields
>
> << File: ENVELOPE.TXT >>
>
--------------------------------------------------------------------------  --
>How can I split a s9(4) binary field (16 bits), into 2 8 bit fields.
>I've seen where 2 "X" are used but I can't convert them to numeric data.
>
>Thanks!
>
> --
>Ron Horner
>HP3000 Systems Administrator
>JCPenney Logistics
>[log in to unmask]
>(414) 259-2274
>
Ric
[log in to unmask]

ATOM RSS1 RSS2