View previous topic :: View next topic
|
Author |
Message |
kedianirmal
New User
Joined: 08 Feb 2008 Posts: 82 Location: Bangalore, India
|
|
|
|
Hi,
I want to add and substract a value in SORT to a given input.
Input file:
Code: |
291 091005 06/10/2009 01:00 |
Expected Output file: i.e. substracting and adding 10 to the first 3 byte 291
I am able to add or substract only at once.
Sort Parm Used:
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1:1,3,ZD,ADD,+10) |
Is it possible to perform the above task in one step. Please help.
Thanks
Nirmal |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use these DFSORT control statements to do what you asked for:
Code: |
SORT FIELDS=COPY
OUTREC BUILD=(1:1,3,ZD,SUB,+10,TO=ZD,LENGTH=3,
13:1,3,ZD,ADD,+10,TO=ZD,LENGTH=3)
|
|
|
Back to top |
|
|
kedianirmal
New User
Joined: 08 Feb 2008 Posts: 82 Location: Bangalore, India
|
|
|
|
Thanks Frank,
Its doing the addition and substraction but the output has A instead of 1.
could you please help with this. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The job works fine with DFSORT which uses F for the TO=ZD sign. You must be using Syncsort, which uses C for the ZD sign.
This is the DFSORT Forum for DFSORT questions. Please post Syncsort questions in the JCL Forum.
I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort. |
|
Back to top |
|
|
|