View previous topic :: View next topic
|
Author |
Message |
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
Hi
I have a file of this format
File length is 80
+181818181.99ABCDDKJHDJHSDJASD
-481818181.99ABCDDKJHDJHSDJASD
-381818181.99 ABCDDKJHDJHSDJASD
+281818181.99ABCDDKJHDJHSDJASD
want o/p as (only the signs reversed in the first numeric amount field.)
-181818181.99ABCDDKJHDJHSDJASD
+481818181.99ABCDDKJHDJHSDJASD
+381818181.99 ABCDDKJHDJHSDJASD
-281818181.99ABCDDKJHDJHSDJASD
I do not have access to ICETOOL . How to implement this?
Thanks
Nirmal |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Multipy it by -1
Look for use of MUL in DFSORT |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Use below step to get desired output...
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTMSG DD SYSOUT=*
//SORTIN DD DSN=input dataset
//SORTOUT DD DSN=output dataset
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,13,SFF,MUL,-1,EDIT=(STTTTTTTTT.TT),SIGNS=(+,-),14,57)
/*
|
Nirmal wrote: |
I do not have access to ICETOOL . |
What do you mean by this? Can you clarify? |
|
Back to top |
|
|
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
Good, thanks
But I faced an error. The value was repeated twice, one with old value & the other with new value.
-181818181.99+181818181.99 like this
How to eliminate the older value from the row? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Can you please show input data and sortcard you have used? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Nirmal,
Assuming your numeric field is in positions 1-13 as shown in your example, you can use a DFSORT job like this to do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
+181818181.99ABCDDKJHDJHSDJASD
-481818181.99ABCDDKJHDJHSDJASD
-381818181.99 ABCDDKJHDJHSDJASD
+281818181.99ABCDDKJHDJHSDJASD
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(1:1,13,SFF,MUL,-1,EDIT=(STTTTTTTTT.TT),SIGNS=(+,-))
/*
|
SORTOUT would have:
Code: |
-181818181.99ABCDDKJHDJHSDJASD
+481818181.99ABCDDKJHDJHSDJASD
+381818181.99 ABCDDKJHDJHSDJASD
-281818181.99ABCDDKJHDJHSDJASD
|
|
|
Back to top |
|
|
nirmal.poikaikumaran
New User
Joined: 29 Nov 2005 Posts: 66 Location: Bangalore
|
|
|
|
Thanks to Frank & Sambhaji... it worked now |
|
Back to top |
|
|
|