|
View previous topic :: View next topic
|
| Author |
Message |
vishal_a
New User

Joined: 24 May 2005 Posts: 45 Location: Noida
|
|
|
|
please help
i have got one file how to break it into two or more files  |
|
| Back to top |
|
 |
radhakrishnan82
Active User

Joined: 31 Mar 2005 Posts: 435 Location: chennai, India
|
|
|
|
| Under what condition do you need to break into more than one file? |
|
| Back to top |
|
 |
Rupesh.Kothari
Member of the Month

Joined: 27 Apr 2005 Posts: 463
|
|
|
|
Hi,
U can break file in more than one file by using STOPAFT and SKIPREC in sort. So that it can copy particular number of records in file.
Regards
Rupesh |
|
| Back to top |
|
 |
bonniem
New User

Joined: 09 Aug 2005 Posts: 67
|
|
|
|
If your control card has the following OUTFIL statement
SORT FIELDS=COPY
OUTFIL FILES=(1,2),SPLIT
Then the input records will be evenly split between the output files. In this above case there are 2 output files. The first output file will have record numbers 1,3,5, etc and the second file will have 2,4,6 etc. |
|
| Back to top |
|
 |
jz1b0c
Active User

Joined: 25 Jan 2004 Posts: 160 Location: Toronto, Canada
|
|
|
|
Hi Vishal,
Here is the example.
//JZ1B0CQ JOB (JZ1B0C,@),
// 'OUTFIL EXAMPLE',
// CLASS=0,
// MSGCLASS=R,
// TIME=(60),
// MSGLEVEL=(1,1),
// NOTIFY=JZ1B0C
//STEP010 EXEC PGM=SORT ,COND=(0,NE)
//*
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*
//SORTIN DD DSN=JZ1B0C.MASTER.INPUT,
// DISP=SHR
//*
//FILE1 DD DSN=JZ1B0C.SPLIT.FILE1,
// DISP=(NEW,CATLG),RECFM=FB,LRECL=80,
// UNIT=SYSDA,
// MGMTCLAS=WORK5
//*
//FILE2 DD DSN=JZ1B0C.SPLIT.FILE2,
// DISP=(NEW,CATLG),RECFM=FB,LRECL=80,
// UNIT=SYSDA,
// MGMTCLAS=WORK5
//*
//FILE3 DD DSN=JZ1B0C.SPLIT.FILE3,
// DISP=(NEW,CATLG),RECFM=FB,LRECL=80,
// UNIT=SYSDA,
// MGMTCLAS=WORK5
//*
//SYSIN DD *
SORT FIELDS(1,4,CH,A)
OUTFIL INCLUDE=(1,4,CH,EQ,C'2001'),FNAMES=FILE1
OUTFIL INCLUDE=(1,4,CH,EQ,C'2002'),FNAMES=FILE2
OUTFIL SAVE,FNAMES=FILE3
END
/*
File3 is going to have the one's that are not in file1 and file2 |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| i have got one file how to break it into two or more files |
How exactly you would do that depends entirely on how you want to break up the files as demonstrated by the different approaches suggested by other posters. See the following for several ways to split a file with DFSORT:
www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmst01.html#t01
If you need more specific help, you need to state exactly what it is you want to do. |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|