How to change the sign of a variable from positive to negative

Document ID : KB000033198
Last Modified Date : 14/02/2018
Show Technical Document Details

Summary: 

I am trying to change the "+" on the variable below to "-" but it goes back to "+" if I make it "-".

_____OUT-LOT-OID-AMT-LCL l +000000000000500.000 
 
043446* DESCRIPTION: The routine will format the a/a driver vars.
043447************************************************
U===> IF OUT-LOT-OID-AMT-LCL NOT = 0

How do I change the variable to a negative (-)?   

Instructions: 

The example above shows the value of the literal OUT-LOT-OID-AMT-LCL displayed in a "Keep Window" at the top of the Source Listing Display while the program is stopped at an Unconditional Breakpoint at statement 043448.  However the sign (+) cannot be changed directly from this display.  In order to change the sign of a variable from a positive (+) to a negative (-), follow these steps:

  • Either from the Keep Window display or on line 043448, enter a "D"  to the left of the literal (overtype the U at the breakpoint if using line 043448) and tab your cursor to a spot underneath the literal OUT-LOT-OID-AMT-LCL and press ENTER to initiate a CORE display of the literal.
  • The results are:
    • At the top of the display:
      • OUT-LOT-OID-AMT-LCL l +000000000000500.000 
    • At the bottom of the display:
      • CORE='OUT-LOT-OID-AMT-LCL'
      • CAIN0491 VALUE OF FIELD = +000000000000500.000
  • Press ENTER again to display the literal in storage. (+0 at the storage address) 
    • At the top of the display:
      • +0  00000000 00000500 00C
    • At the bottom of the display:  
      • CORE='OUT-LOT-OID-AMT-LCL'
      • CAIN0491 VALUE OF FIELD = +500000
  • Tab to the top of the display and overtype the value 00000000 00000500 00C with
    00000000 00000500 00D and press ENTER.
    • At the top of the display:
      • +0  00000000 00000500 00D
    • At the bottom of the display:
      • CORE= 'OUT-LOT-OID-AMT-LCL'
  • Press enter again to see the literal and the value of the field at the top and bottom:
    • Top:
      • +0  00000000 00000500 00D
    • Bottom:
      • CORE= 'OUT-LOT-OID-AMT-LCL'
      • CAIN0491 VALUE OF FIELD = -500000

 

Additional Information:

Refer to the CA InterTest for CICS r9.1 User Guide for more information on working with signed integers.