Converting positive-signed packed and display fields to neutral-signed.

Sometimes in IMAGE/SQL datasets, packed (Pn) and display (Zn) data type fields hold positive-signed data. To get Suprtool to convert these fields to neutral-signed data you can use an arithmetic operation on the EXTRACT command.

In this example we have a zoned display field that was entered with a positive sign, notice the LIST command shows the sign and the OUTPUT command shows it with an alphabetic "E" overpunch.

Item:
   CUST-ACCOUNT          Z8

>get d-sales
>extract cust-account
>list
>output *
>xeq

>GET D-SALES (8) >OUT $STDLIST (0)
CUST-ACCOUNT    = +5

0000000E
IN=5, OUT=1. CPU-Sec=1. Wall-Sec=1.

Now try the same task with an arithmetic operation on the EXTRACT command:

>get d-sales
>extract cust-account = cust-account * 1
>list
>output*
>xeq

>GET D-SALES (8) >OUT $STDLIST (0)
CUST-ACCOUNT    = 5

00000005
IN=5, OUT=1. CPU-Sec=1. Wall-Sec=1.

....Back to the Suprtool Q&A Page