View previous topic :: View next topic
|
Author |
Message |
salltm
New User
Joined: 21 Aug 2008 Posts: 8 Location: china
|
|
|
|
Hi. All, i have a problem:
file A:
Quote: |
AAAA 10{ --- 10{ means '-100'
AAAA 10} --- 10} means '+100'
BBBB 23{
AAAA 33{ |
The first 4 bit is the KEY, and the next is the money.
my requirement is to remove some 'group record'
say: the 'AAAA 10{ ' and 'AAAA 10} ' . they have the same key. but the
money = -1 X money of other record.
in my requirement. i need to remove the two record.
and the output will have
i want to use 'SORT' to do it.
can anyone help me to design the sort card. thanks a lot. |
|
Back to top |
|
|
gylbharat
Active Member
Joined: 31 Jul 2009 Posts: 565 Location: Bangalore
|
|
|
|
This might help
SORT FIELDS=(1,4,CH,A)
SUM FIELDS=(6,3,ZD) |
|
Back to top |
|
|
salltm
New User
Joined: 21 Aug 2008 Posts: 8 Location: china
|
|
|
|
gylbharat wrote: |
This might help
SORT FIELDS=(1,4,CH,A)
SUM FIELDS=(6,3,ZD) |
thanks for your reply.
but i don't want to do the Sum().
Code: |
AAAA 10{
AAAA 10}
BBBB 23{
AAAA 33{
BBBB 43{ |
The output shuld be:
Code: |
BBBB 23{
AAAA 33{
BBBB 43{ |
because i just need to remove some record with same absolute value.
remove 100 and -100. if there is no any record matchs. just keep it.
say: the 'BBBB 43{', there is no record like 'BBBB 43}' , It should be kept. |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
Will always absolute + - value will come consicutively like you have shown in the example? |
|
Back to top |
|
|
Escapa
Senior Member
Joined: 16 Feb 2007 Posts: 1399 Location: IL, USA
|
|
|
|
What is the expected output for below sample input?
Code: |
AAAA 10{
AAAA 10}
BBBB 23{
AAAA 33{
BBBB 43{
AAAA 10}
BBBB 43}
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
salltm,
You need to do a much better job of explaining the complete rules for what you want to before anyone can help you.
10{ is X'F1F0C0' which is a ZD field of -100.
10} is X'F1F0D0' which is a ZD field of +100.
Do you have values that end with something other than { and } such as 10E = X'F1F0C5' = +105 and 10N = X'F1F0D5' = -105? If so, how do you want to handle those.
Can you only have two records with each key and +/- value, or can you have more. For example, could you have:
Code: |
AAAA 10{
AAAA 10}
AAAA 10{
BBBB 10}
BBBB 10}
BBBB 10{
BBBB 10{
BBBB 10{
|
and if so, what would you want for output in that case based on what rules?
You need to show a better example of input that covers all possible cases of interest and the expected output for those cases. You need to explain the complete rules for getting from input to output. Also, give the RECFM and LRECL of your input file, and the starting position, length and format of all relevant fields. |
|
Back to top |
|
|
|