View previous topic :: View next topic
|
Author |
Message |
kalukakkad
New User
Joined: 10 Mar 2005 Posts: 81
|
|
|
|
Hi,
I need to Subtract 1000 from a numeric field in the file.
e.g.
File Layout
ABCD1234
ADGH2345....
my output should be
ABCD0234
ADGH1345
how can i do this using DFSORT. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You didn't say what format you wanted for the output, so I'll assume it's ZD. Here's a DFSORT job that will do what you asked for.
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
ABCD1234
ADGH2345
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(5:5,4,ZD,SUB,+1000,TO=ZD,LENGTH=4)
/*
|
|
|
Back to top |
|
|
kalukakkad
New User
Joined: 10 Mar 2005 Posts: 81
|
|
|
|
Thanks Frank, but the output is coming as
ABCD023D
DEFR134E
whereas it should be...
ABCD0234
ADGH1345
how to format it |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
The job gives the correct output with DFSORT since DFSORT uses an F sign for TO=ZD or TO=ZDF and a C sign for TO=ZDC. So you must be using Syncsort which gives a C sign for TO=ZD. 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 |
|
|
kalukakkad
New User
Joined: 10 Mar 2005 Posts: 81
|
|
|
|
Thanks Frank, sorry for raising the question in the wrong forum, but your replies did help me get the result using some syncsort formatting. |
|
Back to top |
|
|
kalukakkad
New User
Joined: 10 Mar 2005 Posts: 81
|
|
|
|
i used M11 formatting
//SYSIN DD *
OPTION COPY
INREC OVERLAY=(1:1,4,5:5,4,ZD,SUB,+1000,M11,LENGTH=4)
/* |
|
Back to top |
|
|
|