1st record: f1page1
---------
---------
2nd record f1page1
----------
----------
and 3 files has similar structure.
Now i want to split these 3 files into 10 different files based on f1page1. that means read the first file, if it is f1page1 then first file and if it is 25001 record then second file, if it is 50001 3rd file etc.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
sudhakar1979 wrote:
Now i want to split these 3 files into 10 different files based on f1page1. that means read the first file, if it is f1page1 then first file and if it is 25001 record then second file, if it is 50001 3rd file etc.
It is not clear as to what you are trying to do. Do you mean to say that would only split one file into 10 files based on the first record of each file?
Please show us a sample of input and desired output along with DCB properties of input and output files.
ok. i have changed my mind. now i want to split one file into 10 different files. the input file count may not be fixed count. it could be 50000 or 100000. i want to read the count of input file split it into 10 different file.
ex: if it is 100000 then it should be 10000 in each file.
as i showed in my earlier post
the input is
f1page1
------------
------------
------------
f1page1
------------
-----------
-----------
like this. each time we read 'f1page1' the counter needs to incremented. if 100000 file 1-10000 is file 1, 10001-20000 is file 2 like that.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
sudhakar1979,
It is still not clear as to what you want to do. Lets take a simple example.
Say you have one file and it has 12 records
Code:
01
02
03
04
05
06
07
08
09
10
11
12
Total no: of records = 12 and no: of files to be split = 10
So 12/10 = 1 (decimals are ignored)
So you can copy 1 record into each of the file but what do you want to do with the last 2 records? Do you want discard them? or do you want them in the last file?
Also what happens if the no: of records are less than 10? How do you split them?
obviously the records should be in millions. there is no point of you know less than 10 records.
first of all is it possible to write 1st record in first file, 2nd record in second file.. etc and 11th record is again in 1st and 12th record is in 2nd file etc ? if yes, how can I acheive that.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Quote:
Hi Skolusu,
obviously the records should be in millions. there is no point of you know less than 10 records.
sudhakar1979,
IMHO You need to write code which would cover all scenarios, not just your current day requirement. Just because you have million records today does not mean it will always be true. 2 years down the line you might encounter an empty file or file with just 1 record and the solution still need to function as is instead of abending. That is the reason I asked "what if?"
On the other hand I think your requirement is quite simple , you just complicated it for no reason. From your latest post I am assuming that you want to split a group of records into 10 individual files.
If that is the case then it is very easy to split using the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) like this:
what a super man you are. unfortunately as you said i am getting syntax error. trying to resolve with system people. Is there any other way? just curious.
SYNCSORT 1.3.0.0 IS NOT LICENSED FOR SERIAL 78921, TYPE 2097 611, LPAR
PRODUCT WILL STOP WORKING IN 41 DAYS UNLESS A VALID KEY IS INSTALLED.
SYSDIAG= 115634, 1368960, 1368960, 2015106
6,912K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
64K BYTES RESERVE REQUESTED, 272K BYTES USED
4K BYTES OF EMERGENCY SPACE ALLOCATED
SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
4,860K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
0 BYTES RESERVE REQUESTED, 156K BYTES USED
SYNCSMF CALLED BY SYNCSORT; RC=0000
SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
BSAM WAS USED FOR SORTIN
BSAM WAS USED FOR SORTOUT
RCD IN 1, OUT 1
RELEASE 1.3 BATCH 0485 TPF LEVEL 0.0
END SYNCSORT -
,STEP0100,,DIAG=A200,600A,8AAC,0046,EA52,4CA3,0
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Sudhakar1979,
From your sysout messages it is evident that you are using syncsort. I'm a DFSORT developer. DFSORT and Syncsort are competitive products. I'm happy to answer questions on DFSORT and DFSORT's ICETOOL, but I don't answer questions on Syncsort.