View previous topic :: View next topic
|
Author |
Message |
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
I want to copy first 50 records from an input file to output file.
How can I do it in JCL? Can anyone help me please ? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
Back to top |
|
|
rajesh_mbt
New User
Joined: 27 Mar 2006 Posts: 97 Location: India
|
|
|
|
Moderaor
Thank you very much... |
|
Back to top |
|
|
sameer
New User
Joined: 10 Mar 2005 Posts: 41 Location: United States Of America
|
|
|
|
use SORT & STOPAFT=50 |
|
Back to top |
|
|
cjcpr
New User
Joined: 21 Mar 2006 Posts: 21 Location: USA
|
|
|
|
sameer wrote: |
use SORT & STOPAFT=50 |
This is the quick and easy way. |
|
Back to top |
|
|
raviprasath_kp Warnings : 1 New User
Joined: 20 Feb 2005 Posts: 65 Location: chennai
|
|
|
|
i think we can give FROMKEY AND TOKEY COMMAN
PLEASE VERIFY |
|
Back to top |
|
|
lal_arun_272
New User
Joined: 09 Oct 2006 Posts: 31 Location: Bangalore
|
|
|
|
Hi Please find an example how to copy 50 infile record into output file
//STEP01 EXEC PGM=IDCAMS
//INDATA DD DSN=INPUTFLE1,
// DISP=SHR
//OUTDATA DD DSN=OUTPUTFILE,
// DISP=(NEW,CATLG,CATLG),
// DCB=(BLKSIZE=0,LRECL=75,RECFM=FB),
// SPACE=(TRK,(75,150),RLSE),
// UNIT=SYSDA
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSIN DD *
REPRO INFILE(INDATA) OUTFILE(OUTDATA) COUNT(50)
/*
Thanks
Arunlal |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
With DFSORT:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY,STOPAFT=50
/*
|
|
|
Back to top |
|
|
rini
New User
Joined: 16 May 2006 Posts: 6
|
|
|
|
Startrec and Endrec option can also be given.
Code: |
//step1 EXEC PGM=SORT
//sysout dd sysout=*
//sortin dd dsn=......input file
//sortof01 dd dsn=......output file
//sysin dd *
sort fields=copy
outfil files=01, startrec=01,endrec=50
/*
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
Startrec and Endrec option can also be given |
Well, that would be:
Code: |
SORT FIELDS=COPY
OUTFIL FILES=01,STARTREC=01,ENDREC=50
|
but STARTREC=01 isn't needed in this case.
However, STOPAFT=50 is more efficient than ENDREC=50. With STOPAFT=50, DFSORT actually stops reading input records after the first 50 have been read, whereas with ENDREC=50, DFSORT reads all of the records. |
|
Back to top |
|
|
|