Remove special characters from fields

What are we doing?
We are trying to convert ADABAS data to DB2 format data and then verify if all data has been migrated. We are able to convert ADABAS to DB2 and load the data in DB2. Now I am trying to verify all the data. I have have 2 datasets ADABAS datasets has data from ADABAS using WRITE command. second dataset has data from DB2 tables. My plan is to be able to a comparison of both files using Super C in mainframe.

Issue:
Differences
ADABAS DATA DB2 DATA
NW896} 0 896} NW-8960 0 -8960

I want output as -8960 in place of 896}. If there is no value then I want just ‘0’(zero).
Snapshot of data is below.


ADABAS Data
NN7120  7120   J     NN0 
NN750}  0     750}  NN4320  0
NW896}  0     896}  NN0 

DB2DATA
NN7120  7120   -1   NN0  
NN-7500 0     -7500 NN4320  0
NW-8960 0     -8960 NN0

01 DDM-VIEW VIEW OF exxxA 
02 exxx-Q-vvv-TOTAL-THIS-YR /* (N5) 
02 exxx-Q-vvv-EARNED-UNUSED /* (N5) 
02 exxx-Q-ccccc-SICK /* (N9)    

01 DB2-exxxA
02 exxx_Q_vvv_TOTAL_THIS_YR (A6)  /* N5 + SIGN
02 exxx_Q_vvv_EARNED_UNUSED (A6)  /* N5 + sign
02 exxx_Q_ccccc_SICK (A10)  /* N9 + sign

   MOVE LEFT  DDM-VIEW.exxx-Q-vvv-TOTAL-THIS-YR              
     TO DB2-exxxA.exxx_Q_vvv_TOTAL_THIS_YR 
   MOVE LEFT   DDM-VIEW.exxx-Q-vvv-EARNED-UNUSED            
     TO DB2-exxxA.exxx_Q_vvv_EARNED_UNUSED
   MOVE LEFT   DDM-VIEW.exxx-Q-ccccc-SICK                   
     TO DB2-exxxA.exxx_Q_ccccc_SICK      

WRITE WORK 1  
               DB2-exxxA.exxx_Q_vvv_TOTAL_THIS_YR
                    DB2-exxxA.exxx_Q_vvv_EARNED_UNUSED
                    DB2-exxxA.exxx_Q_ccccc_SICK 

I tried remove special characters using EM. It fixes the problem but then number get righ justified and comparison again fails.
I tried below.


  MOVE EDITED DDM-VIEW.exxx-Q-ccccc-SICK (EM=-ZZZZZZZZ9)
* MOVE LEFT   DDM-VIEW.exxx-Q-ccccc-SICK                
    TO DB2-exxxA.exxx_Q_ccccc_SICK     
                

Before above fix data was:



      0       0       0         0   WIS0  S0  MN   4541
      0       0       96}       0   MNS0  S0  MN   2663
      0       0       15780     168 WIM1  M1  MN   0359
      0       0       0         0     S0  S0  MN   4968
      0       0       0         0   WIS0  S0  XS   6696
      0       0       0         0   NDS0  S0  MN   0329
      0       0       99579     403 MNM0  M0  MN   4968

After above fix the data is as below:


      0       0                00   WIS0  S0  MN   45416GNDL02
      0       0             -9600   MNS0  S0  MN   26630GNDM01
      0       0            15780168 WIM1  M1  MN   0359CGNDM02
      0       0                00     S0  S0  MN   4968AGNDM03
      0       0                00   WIS0  S0  XS   66965GNDN01
      0       0                00   NDS0  S0  MN   03290GNDR01
      0       0            99579403 MNM0  M0  MN   4968LGNDR02
      0       0            144600   MNS0  S0  MN   2160DGNDS01

Can anyone please suggest/guide/advice ?

[quote=Ashish Srivastava]
I tried below.

MOVE EDITED DDM-VIEW.exxx-Q-ccccc-SICK (EM=-ZZZZZZZZ9)
* MOVE LEFT   DDM-VIEW.exxx-Q-ccccc-SICK                
    TO DB2-exxxA.exxx_Q_ccccc_SICK

Try changing this to

MOVE EDITED DDM-VIEW.exxx-Q-ccccc-SICK (EM=-ZZZZZZZZ9) TO DB2-exxxA.exxx_Q_ccccc_SICK
MOVE LEFT    DB2-exxxA.exxx_Q_ccccc_SICK TO DB2-exxxA.exxx_Q_ccccc_SICK

Having given this more thought, here’s a one-statement alternative.

COMPRESS NUMERIC DDM-VIEW.exxx-Q-ccccc-SICK INTO DB2-exxxA.exxx_Q_ccccc_SICK

Ralph Thank!!

I tried first option and it works for me ( I had tried this before not sure why did not work then).

COMPRESS NUMERIC throws below error.
NAT0099 Field error in a COMPRESS statement.

Ashish

Sorry. The NAT0099 must be a version issue. I don’t have access to a mainframe and am testing with Natural 8.3 under Windows.