View previous topic :: View next topic
|
Author |
Message |
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi All,
Please tell me how to insert numeric 1 at the end of record.
I/P file length 80
I tried this
INREC FIELDS= (1,80,C'1')
but in this case it is treating 1 as a character & I m not able to do SUM operation on 81st byte. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
What do you mean by "numeric 1"? C'1' is X'F1' which is a valid ZD value of +1. You can SUM that as a ZD value. If you mean something else by "numeric 1" other than a ZD +1, tell us what you mean. Or explain what you mean by "I'm not able to do SUM operation on 81st byte". |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi Frank,
Sorry for not making my prev post clear l
INREC FIELDS=(1,80,C'1')
SORT FIELDS=(10,3,CH,A)
SUM FIELDS=(80,1,ZD)
It is giving me SOC7 in that case. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You have 1,80,C'1' for INREC which puts the '1' (X'F1') in position 81, but you have 80,1,ZD for SUM which is summing on position 80 rather than position 81. You need 81,1,ZD for SUM:
Code: |
INREC FIELDS=(1,80,C'1')
SORT FIELDS=(10,3,CH,A)
SUM FIELDS=(81,1,ZD)
|
Note that if you want to ensure that the SUM in 81 is printable, you should also use:
|
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
HI Frank,
Thanks alot my mistake..
Sorry to bug u so much |
|
Back to top |
|
|
|