Stop copying the records from sort once i find a string



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Stop copying the records from sort once i find a string

Postby Deepika 1992 » Mon Feb 19, 2018 3:16 pm

Hi all,
am new to this site. i have a requirement similar to this but i need to be done that sort based on count.
input file:
123456789BKVOLxxxx
1212312487289yyyyyy
jfasjkjkshk;sadfjjjsff
99999999sWOOTHshg
123456789BKVOLxxxx
1212312487289yyyyyy
13wrgbfghg;sadfjjjsff
99999999sWOOTHshg123456789BKVOLxxxx
1212312487289yyyyyy
jfasjkjkshk;sadfjjjsff
99999999sWOOTHshg
.
.
.


now output should be : If BKVOL is found more than 24 times we need to del records as below
The way to check is to do a find on ‘bkvol’, it should occur 24 times. If it is more than 24, then you will have to copy the files and delete everything after the 24th occurrence of ‘wooth’.

please help me i saves me a lot of time.

Thanks in Advance
Deepika 1992
 
Posts: 4
Joined: Mon Feb 19, 2018 3:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Stop copying the records from sort once i find a string

Postby enrico-sorichetti » Mon Feb 19, 2018 3:42 pm

it is considered bad manners to tailgate an existing topic with a new question
( especially if the topic is 8 year old )
topic split
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 3006
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 165 times

Re: Stop copying the records from sort once i find a string

Postby NicC » Mon Feb 19, 2018 4:04 pm

It is not clear what you want. Do you want only a maximum of 24 references to BKVOL or do you want to stop all output after the 24th BKVOL? Can BKVOL occur more than once per inut record? What are the data set properties (LRECL RECFM)?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Stop copying the records from sort once i find a string

Postby Deepika 1992 » Mon Feb 19, 2018 5:18 pm

Hi,
Lrecl is 80..
I need to check if bkvol(header) is occurring more than 24 times, if it occurs more than 24 times we need to del all the recorda after the 24th occurence of Wooth (trailer )
Bkvol and wooth occurs only once per record..
Deepika 1992
 
Posts: 4
Joined: Mon Feb 19, 2018 3:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Stop copying the records from sort once i find a string

Postby NicC » Mon Feb 19, 2018 6:34 pm

And the RECFM is? The solution can be different for VB and FB RECFMs
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Stop copying the records from sort once i find a string

Postby Deepika 1992 » Mon Feb 19, 2018 6:36 pm

Its fb file
Deepika 1992
 
Posts: 4
Joined: Mon Feb 19, 2018 3:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Stop copying the records from sort once i find a string

Postby NicC » Mon Feb 19, 2018 8:31 pm

Your GROUP BEGINs with a record containing BKVOL and ends with the record containing WOOOTH. When OUTFIL processing you check for the sequence number being less than 25. The explanation is in the replies that Frank wrote. What he did not mention is that you have to drop the sequence number in OUTFIL processing by building your output record from bytes 1-80 (unless, of course, you want the sequence numbers).
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Stop copying the records from sort once i find a string

Postby Deepika 1992 » Tue Feb 20, 2018 12:06 pm

Thanks Nic..
:( but could you please elaborate your explanation with code.
Deepika 1992
 
Posts: 4
Joined: Mon Feb 19, 2018 3:02 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Stop copying the records from sort once i find a string

Postby NicC » Tue Feb 20, 2018 2:05 pm

No, you will not learn if you are given code. The topic that you had tail-gated originally has most of the code that you want - you just have to adjust it for your circumstances. The final bit, dropping the sequence number during OUTFIL process, is done by using BUILD, examples of which abound in the forum.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post