Easytrieve - Removing leading zero in numeric variable

1.2k views Asked by At

Using Easytrieve program am trying to fetch the details from DB2. But one off the column is having integer datatype and am moving the data to binary variable. And I need to perform arithmetic operation in this variable and result will be move to output file.

When i try to move binary value to alpha numeric am getting leading zero.

Not sure how to remove those leading value.

For example :

DB2 column name (Period_value) = 240 
Easytrieve : 
FILE TEMP1 
  TEMP-PERIOD     1   5  A 

WS-VAL1    W  4 B 0    
WS-TEMP    W  4 N 

.... 
....

using cursor to get the value from Db2

WS-VAL1 is holding the value 240

DISPLAY  WS-VAL1                  => OUTPUT : 240 

* CALCULATION

WS-VAL1 = WS-VAL1 + 1 

WS-TEMP = WS-VAL1

DISPLAY WS-TEMP         ->  OUTPUT : 0241 

MOVE  WS-TEMP to TEMP-PERIOD

PUT TEMP1 

But output file contains

0241 

Expected output 
241 
242 (without leading zero) 

Could someone help me on this.

0

There are 0 answers