View previous topic :: View next topic |
Author |
Message |
Martin Beginner

Joined: 20 Mar 2006 Posts: 133 Topics: 58
|
Posted: Thu Jan 14, 2010 11:18 am Post subject: copy every 5th record from the input file |
|
|
Hi,
I have an I/P file with zillions of records and I need to copy every 5th record to the O/P file. Is there a way to achieve this using SORT?
File is 80 byte length and is FB
Thanks,
Martin |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Thu Jan 14, 2010 12:12 pm Post subject: |
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL STARTREC=5,SAMPLE=5
/*
|
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
 |
Martin Beginner

Joined: 20 Mar 2006 Posts: 133 Topics: 58
|
Posted: Thu Jan 14, 2010 12:42 pm Post subject: |
|
|
Thanks Frank for the quick reply ! |
|
Back to top |
|
 |
|
|