Page 1 of 1

Negative sign is in last byte to be moved to first

PostPosted: Sat Apr 14, 2012 10:10 am
by trilochan_p
Hi,

I have amount numeric input data where negative sign is in last byte and i wants this sign symbol into front of the amount field as mentioned below.
Please help me on this.

INPUT DATA - STARTING FROM COLUMN POSITION - 106 TO 120 and negative sign symbol in 120th position.

----1----+----2
        642.32-
     27,310.52-
      8,272.06
    218,232.06-
  1,459,410.83-


OUTPUT DATA - REQUIRED STARTING FROM COLUMN POSITION - 106 TO 120
----1----+----2
        -642.32
     -27,310.52
       8,272.06
    -218,232.06
  -1,459,410.83

Re: Negative sign is in last byte to be moved to first

PostPosted: Sat Apr 14, 2012 4:22 pm
by BillyBoyo
For testing I used your figures, pasted into SYSIN at column 1. So you'll need to change 1,15 to 106,15.

Look up SFF and EDIT/SIGNS in the manual.

For your next posting, please use the Code tags, which preserve spacing, for any data or code that you post.

//NUMEDIT  EXEC PGM=SORT
//SORTIN DD *
        642.32-
     27,310.52-
      8,272.06
    218,232.06-
  1,459,410.83-
//SYSOUT   DD SYSOUT=*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
 OPTION COPY
 INREC OVERLAY=(1:1,15,SFF,
       EDIT=(SIII,III,IIT.TT),SIGNS=(,-))