Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SPLITBY, keep groups together

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
adoerner

New User


Joined: 25 Apr 2007
Posts: 11
Location: Germany

PostPosted: Mon May 06, 2013 2:00 pm    Post subject: SPLITBY, keep groups together
Reply with quote

Hello !

I want to split a file with 12 records into 3 Datasets with 4 records.
That's no problem using SPLITBY, for example

Code:
OUTFIL FNAMES=(OUT1,OUT2,OUT3),SPLITBY=4


But I want to keep records with the same sortkey into the same file:
Code:
//SORTIN DD *
AAAA1
AAAA2
AAAA3
AAAA4
AAAA5
BBBB1
BBBB2
BBBB3
BBBB4
CCCC1
CCCC2
CCCC3


Sortkey = 1,4,CH,A

This is the result I want to receive:
Code:

File 1
AAAA1
AAAA2
AAAA3
AAAA4
AAAA5

File 2
BBBB1
BBBB2
BBBB3
BBBB4

File3
CCCC1
CCCC2
CCCC3


Ist there a parameter for SPLITBY to keep all records of a SORTKEY into one file ?

Greetings Axel
Back to top
View user's profile Send private message

Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1529
Location: Andromeda Galaxy

PostPosted: Mon May 06, 2013 2:18 pm    Post subject:
Reply with quote

Is the key Dynamic from one run to another?
Back to top
View user's profile Send private message
adoerner

New User


Joined: 25 Apr 2007
Posts: 11
Location: Germany

PostPosted: Mon May 06, 2013 2:24 pm    Post subject:
Reply with quote

Pandora-Box wrote:
Is the key Dynamic from one run to another?

Yes. It's just an example, in the real world I have to split about 200 million records into 50 files. But the problem is the same.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon May 06, 2013 3:11 pm    Post subject: Reply to: SPLITBY, keep groups together
Reply with quote

the question has been asked quite a few times...

in general You will need two passes over the data,
the first to determine the split point, the second to do the split

unfortunately a generic question will only get a generic reply ...

how many output files,
how many keys expected, the number of record for each key ... ... ...

see here for a discussion on a similar issue
http://ibmmainframes.com/viewtopic.php?t=58088&highlight=split
Back to top
View user's profile Send private message
adoerner

New User


Joined: 25 Apr 2007
Posts: 11
Location: Germany

PostPosted: Mon May 06, 2013 3:55 pm    Post subject: Re: Reply to: SPLITBY, keep groups together
Reply with quote

enrico-sorichetti wrote:
...
see here for a discussion on a similar issue
http://ibmmainframes.com/viewtopic.php?t=58088&highlight=split
...


Thank you for the information, I know the 'hard' way to code with SEQNUM, WHEN=GROUP, PUSH etc. I just searching an easy method like:
Code:
SORT FIELDS=(1,4,CH,A)
OUTFIL FNAMES=(OUT1,OUT2,OUT3),SPLITBY=4,KEEPGROUP

KEEPGROUP ist to avoid spanning records with the same key over more than one dataset. It seems, that there is no parameter like this...
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon May 06, 2013 3:59 pm    Post subject: Reply to: SPLITBY, keep groups together
Reply with quote

Quote:
KEEPGROUP

not always You can have what You want icon_cool.gif

the keyword looks simple to specify,
but if You think about the underlying logic it' s not simple at all

I am not really sure that even a two pass approach could solve the problem !
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Mon May 06, 2013 4:54 pm    Post subject: Re: Reply to: SPLITBY, keep groups together
Reply with quote

adoerner wrote:
enrico-sorichetti wrote:
...
see here for a discussion on a similar issue
http://ibmmainframes.com/viewtopic.php?t=58088&highlight=split
...


Thank you for the information, I know the 'hard' way to code with SEQNUM, WHEN=GROUP, PUSH etc. I just searching an easy method like:
Code:
SORT FIELDS=(1,4,CH,A)
OUTFIL FNAMES=(OUT1,OUT2,OUT3),SPLITBY=4,KEEPGROUP

KEEPGROUP ist to avoid spanning records with the same key over more than one dataset. It seems, that there is no parameter like this...


If you know the "hard" way to do it already, why didn't you simply refer to the manual to see the syntax of all the "split" functions.

Then do it the "hard" way, which you'd have already completed if you hadn't been imagining there must be an undocumented "easy" way.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon May 06, 2013 5:05 pm    Post subject: Reply to: SPLITBY, keep groups together
Reply with quote

dumb of me ...
I forgot about the simplest way of all

Code:
//justdoit  exec pgm=iehprophet
//steplib dd disp=shr,dsn=sys1.&deity

since iehprophet knows, no need for control cards nor other dd statements

unfortunately, You will have to bear a 7 days elapsed ( whatever the task )

icon_cool.gif
Back to top
View user's profile Send private message
adoerner

New User


Joined: 25 Apr 2007
Posts: 11
Location: Germany

PostPosted: Mon May 06, 2013 5:29 pm    Post subject:
Reply with quote

OK, the answer is: " No, there is no parameter like this."
Thank you. icon_cool.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon May 06, 2013 5:37 pm    Post subject: Reply to: SPLITBY, keep groups together
Reply with quote

Quote:
OK, the answer is: " No, there is no parameter like this."


if all You wanted was a YES/NO answer You should have told so from the beginning icon_evil.gif
and we would not have wasted time in trying to help
( apart the humor )
Back to top
View user's profile Send private message
adoerner

New User


Joined: 25 Apr 2007
Posts: 11
Location: Germany

PostPosted: Mon May 06, 2013 6:20 pm    Post subject: Re: Reply to: SPLITBY, keep groups together
Reply with quote

enrico-sorichetti wrote:
Quote:
OK, the answer is: " No, there is no parameter like this."


if all You wanted was a YES/NO answer You should have told so from the beginning icon_evil.gif
and we would not have wasted time in trying to help
( apart the humor )


I think, I have told so in the beginning. I didn't wan't you to waste your time. When I made or said something wrong, all I can say is sorry. I'm not an expert in english language, so something went wrong in communication.
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Mon May 06, 2013 6:30 pm    Post subject: Reply to: SPLITBY, keep groups together
Reply with quote

not a problem,
usually people ask YES/NO questions and get p****d when they get a YES/NO answer

here we or at least I thought that You asked for more than that but ... icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Include groups of records jyotsnapanicker SYNCSORT 4 Wed Dec 30, 2015 4:37 pm
No new posts Syncsort - Group Records, count of gr... TS70363 SYNCSORT 18 Thu Jul 17, 2014 2:57 pm
No new posts Combine groups of lines in one line knobi DFSORT/ICETOOL 5 Fri Jun 20, 2014 3:43 am
No new posts DFSORT - splitting a large file by gr... Bruce Malcolm DFSORT/ICETOOL 7 Wed Dec 19, 2012 4:53 pm
No new posts Data Generation Groups and renaming g... Paul Hacker JCL & VSAM 9 Wed Jun 27, 2012 9:00 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us