View previous topic :: View next topic
|
Author |
Message |
kedianirmal
New User
Joined: 08 Feb 2008 Posts: 82 Location: Bangalore, India
|
|
|
|
Hi,
I have a file with 30K records. I want to copy only 15K records out of it to a new file.
Could you please help what will be the easiest way to achieve this.
Thanks
Nirmal |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
IDCAMS REPRO can do it, SORT can do it.
Both sets of manuals are available from the "IBM manuals" button at the top of the page. |
|
Back to top |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
Code: |
//STEP01 EXEC SORTD5
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=USERID.FILE,DISP=SHR
//SORTOF1 DD DSN=USERID.SPLIT1,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),
// DCB=(*.SORTIN)
//SORTOF2 DD DSN=USERID.SPLIT2,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,SPACE=(CYL,(800,200),RLSE),
// DCB=(*.SORTIN)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=(1,2),SPLIT
END
/*
//* |
This will work.. |
|
Back to top |
|
|
kedianirmal
New User
Joined: 08 Feb 2008 Posts: 82 Location: Bangalore, India
|
|
|
|
Actually the count of record in input may vary and i want to restrict it to particular count in the output file. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Which is why I suggested IDCAMS REPRO using the COUNT parameter or you could use SORT with the STOPAFT statement
(Works for DFSORT, can not say for SYNCSORT). |
|
Back to top |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
Try this...
Code: |
//STEP01 EXEC SORT
//SORTIN DD DSN=USERID.FILE,
// DISP=SHR
//SORTOUT DD DSN=USERID.FILE.OP,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(100,100),RLSE),
// DCB=*.SORTIN
//SYSIN DD *
SORT FIELDS=COPY,
STOPAFT=100000
/*
//* |
|
|
Back to top |
|
|
kedianirmal
New User
Joined: 08 Feb 2008 Posts: 82 Location: Bangalore, India
|
|
|
|
Thanks a lot. |
|
Back to top |
|
|
|