View previous topic :: View next topic
|
Author |
Message |
Anitha Sekar
New User
Joined: 17 Jan 2009 Posts: 5 Location: Chennai
|
|
|
|
I have to split the input file in to 10 output files based on the number of records present in the input file. please provide me the jcl |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Quote: |
based on the number of records present in the input file |
What is the basis to split the data ?
Quote: |
please provide me the jcl |
Didnt you search forum?
And what is the sort product you use |
|
Back to top |
|
|
Anitha Sekar
New User
Joined: 17 Jan 2009 Posts: 5 Location: Chennai
|
|
|
|
for example, if i am having 40000 records. first 4000 records should go into 1st file, second 4000 into 2nd file,etc
If i am having 50000 records,first 5000 records should go into 1st file.
I searched it. But i didn't find anything.As it is urgent, I have posted it here. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Unfortunately the only URGENT is yours
It would also help if you actually answered the question regarding the sort product being used that Pandora has asked.
I have just done a quick search on the forum for your question and had 150+ hits. |
|
Back to top |
|
|
Anitha Sekar
New User
Joined: 17 Jan 2009 Posts: 5 Location: Chennai
|
|
|
|
sort,sychsort,iceman,icetool are the sort product being used |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Anitha,
I guess you use SYNCSORT
Try this
Code: |
SORT FIELDS=COPY
OUTFIL FNAMES=(OUT1,OUT2,OUT3,OUT4,OUT5,OUT6,OUT7,OUT8,OUT9,OUT10),SPLIT |
But its sad that you are being very naive for not searching which is at very reach
Code'd |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Anitha Sekar,
With SPLIT, rec1 from input goes to output1, rec2 goes to output2 and so on. Is that what you are expecting?
Quote: |
if i am having 40000 records. first 4000 records should go into 1st file, second 4000 into 2nd file,etc
If i am having 50000 records,first 5000 records should go into 1st file |
For this, you might need to find the total count and divide by 10 to obtain 'n' and generate a dynamic sort card with SPLIT1R=n |
|
Back to top |
|
|
Anitha Sekar
New User
Joined: 17 Jan 2009 Posts: 5 Location: Chennai
|
|
|
|
Hi Arun,
I have to find the count the number of records present in input file and divide by 10 to put it into 10 output files.
Please help me on this.. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Is there any perticular reason why the solution given by Pandora is not acceptable.
That way you do not need to know anything about record counts at all.
Perhaps if you had given a wider view of the problem, an explanation why they must be in consecutive chunks, then that information would help people help you without wasting time and effort.
Quote: |
please provide me the jcl |
This is a HELP forum rather than a DO IT FOR ME forum, but as has been said many times before, if you demand code please be prepared to pay the going rate for the code.
Please show us what you have tried and what the results were. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10886 Location: italy
|
|
|
|
Pandora' s solution will split data with a <rotating> scheme
and that might not be what the TS wants
but if the TS does not tell we will never know |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
My solution will not work as per the requirement but TS needs to implement what Arun has said
My solution will just be an example for the Urgent TS |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Have a look at this one from the Beginner's site. It was there this morning, you could have had the thing finished before you even posted if it was that urgent.
I haven't checked, but I'm sure there are other examples which are easy to find and apply. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
The way to do this using the least machine resources is to have the process that created the whole file create another dataset that has the record count.
Then read the record cont file and generate the OUTFIL statement.
Run the split. |
|
Back to top |
|
|
|