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

SPLITBY, keep groups together


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Global Moderator


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

PostPosted: Mon May 06, 2013 2:18 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 06, 2013 3:11 pm
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
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
Reply with quote

enrico-sorichetti wrote:
...
see here for a discussion on a similar issue
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 06, 2013 3:59 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon May 06, 2013 4:54 pm
Reply with quote

adoerner wrote:
enrico-sorichetti wrote:
...
see here for a discussion on a similar issue
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 06, 2013 5:05 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 06, 2013 5:37 pm
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
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

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Mon May 06, 2013 6:30 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Group changes and numbering the group... DB2 2
No new posts Group changes and numbering the groups DB2 2
No new posts Copy Specific Groups SYNCSORT 10
No new posts RACF - Sub groups - how they work? JCL & VSAM 1
No new posts Split files upto certain limit based ... DFSORT/ICETOOL 5
Search our Forums:

Back to Top