View previous topic :: View next topic
|
Author |
Message |
adoerner
New User
Joined: 25 Apr 2007 Posts: 11 Location: Germany
|
|
|
|
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 |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Is the key Dynamic from one run to another? |
|
Back to top |
|
|
adoerner
New User
Joined: 25 Apr 2007 Posts: 11 Location: Germany
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 |
|
|
adoerner
New User
Joined: 25 Apr 2007 Posts: 11 Location: Germany
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
not always You can have what You want
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
adoerner wrote: |
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 )
|
|
Back to top |
|
|
adoerner
New User
Joined: 25 Apr 2007 Posts: 11 Location: Germany
|
|
|
|
OK, the answer is: " No, there is no parameter like this."
Thank you. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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
and we would not have wasted time in trying to help
( apart the humor ) |
|
Back to top |
|
|
adoerner
New User
Joined: 25 Apr 2007 Posts: 11 Location: Germany
|
|
|
|
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
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
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 ... |
|
Back to top |
|
|
|