View previous topic :: View next topic |
Author |
Message |
Prosenjit2 Beginner
Joined: 02 Mar 2005 Posts: 13 Topics: 8 Location: India
|
Posted: Wed Jul 13, 2005 5:56 am Post subject: How copy even records from a input dataset thru JCL |
|
|
I want to copy the even records of an input dataset to an output file.
Can somebody provide me the JCL to do it. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Jul 13, 2005 6:18 am Post subject: |
|
|
Prosenjit2,
The following JCL will give you the desired results.
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//OUT1 DD DUMMY
//OUT2 DD DSN=YOUR EVEN RECORDS FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FNAMES=(OUT1,OUT2),SPLIT
/*
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Prosenjit2 Beginner
Joined: 02 Mar 2005 Posts: 13 Topics: 8 Location: India
|
Posted: Wed Jul 13, 2005 6:39 am Post subject: |
|
|
thank you very much the jcl worked. |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Wed Jul 13, 2005 10:45 am Post subject: |
|
|
Here's another way to do it with DFSORT that doesn't require the extra DUMMY output:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL STARTREC=2,SAMPLE=2
/*
|
_________________ 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 |
|
 |
|
|