View previous topic :: View next topic
|
Author |
Message |
i413678 Currently Banned Active User
Joined: 19 Feb 2005 Posts: 112 Location: chennai
|
|
|
|
Hi,
I want to split a data set in such a way that one file should contain all even number records and the second file should contain all the odd number records means like below.............
if input file has records like
1 2 3 4 5 6 7 8 9 10 11 12.....................like so on and so forth
I need to split this file as below......
first file should have
1 3 5 7 9 ...................records like
and
second file should have
2 4 6 8 10 12 ....................records like
thx in adv..................
pavan |
|
Back to top |
|
|
rajesh_1183
Active User
Joined: 24 Nov 2005 Posts: 121 Location: Tadepalligudem
|
|
|
|
Quote: |
1 2 3 4 5 6 7 8 9 10 11 12.....................like so on and so forth |
is this a single record...???? or ur record organization is
1
2
3
4
5
.
.
.
Rajesh... |
|
Back to top |
|
|
rajandhla
Active User
Joined: 18 Oct 2005 Posts: 182 Location: Luton UK
|
|
|
|
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=(1,2),SPLIT
/*
After executing this sort job with this sysin, every 1 and 2nd records will go into output files respectively.(there should be two output files specified.
Regards
Jai |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
pavan,
Expanding on jai's response, you can use a DFSORT job like this to do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//ODD DD DSN=... output file1 (odd records)
//EVEN DD DSN=... output file2 (even records)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=(ODD,EVEN),SPLIT
/*
|
|
|
Back to top |
|
|
i413678 Currently Banned Active User
Joined: 19 Feb 2005 Posts: 112 Location: chennai
|
|
|
|
Hi All,
Thank you one and all for promt reply.....
bye 4 now......
pavan |
|
Back to top |
|
|
|