IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Remove some record


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
salltm

New User


Joined: 21 Aug 2008
Posts: 8
Location: china

PostPosted: Tue May 17, 2011 3:27 pm
Reply with quote

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

Code:
BBBB 23{
AAAA 33{


i want to use 'SORT' to do it.

can anyone help me to design the sort card. thanks a lot.
Back to top
View user's profile Send private message
gylbharat

Active Member


Joined: 31 Jul 2009
Posts: 565
Location: Bangalore

PostPosted: Tue May 17, 2011 4:26 pm
Reply with quote

This might help

SORT FIELDS=(1,4,CH,A)
SUM FIELDS=(6,3,ZD)
Back to top
View user's profile Send private message
salltm

New User


Joined: 21 Aug 2008
Posts: 8
Location: china

PostPosted: Tue May 17, 2011 5:01 pm
Reply with quote

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
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 17, 2011 5:59 pm
Reply with quote

Will always absolute + - value will come consicutively like you have shown in the example?
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Tue May 17, 2011 6:13 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue May 17, 2011 11:04 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
Search our Forums:

Back to Top