View previous topic :: View next topic |
Author |
Message |
Bee_bop Beginner
Joined: 12 Dec 2005 Posts: 29 Topics: 15 Location: Singapore
|
Posted: Wed Jun 21, 2006 5:01 am Post subject: Copy Utility |
|
|
Hi Experts,
Would just like to inquire, is there a JCL to copy a dataset that I can specify the specific start line and end line ?
pls help.
Thanks in advance,
- Bee_bop |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Jun 21, 2006 5:28 am Post subject: |
|
|
Bee_bop,
IDCAMS/Sort products are capable of doing what you asked for.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Wed Jun 21, 2006 5:32 am Post subject: |
|
|
Bee_bop,
Can you please tell what exactly do you mean by specific start line and end line and can you post what exactly you are looking for ? _________________ Shekar
Grow Technically |
|
Back to top |
|
 |
Bee_bop Beginner
Joined: 12 Dec 2005 Posts: 29 Topics: 15 Location: Singapore
|
Posted: Wed Jun 21, 2006 5:47 am Post subject: |
|
|
Hi all,
Could you provide me with specific JCL ? I have dataset with PS dsorg and contains 1890000 lines and I want to copy only from 764173 to 1890000 lines.
Thanks,
-Bee_bop |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Wed Jun 21, 2006 6:08 am Post subject: |
|
|
Bee_bop,
Try this code and i am assuming 50 records in my input test file and i want to copy from 26 th record till end of the file that is 50 th record.So in your JCL you would code STARTREC=764173,ENDREC=1890000.Hope this helps you.
Code: |
//STEP010 EXEC PGM=SORT
//SORTIN DD DSN=SHEKAR.TEST.IN,DISP=SHR
//OUT DD DSN=SHEKAR.TEST.OUT,DISP=(NEW,CATLG,CATLG),
// SPACE=(TRK,(1,1),RLSE)
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
OUTFIL FNAMES=OUT,STARTREC=26,ENDREC=50
/*
//
|
INPUT DATASET
Code: |
SHEKAR.TEST.IN
000001 SHEKAR ENGL
000002 KOLUSU COMP
000003 FRANK ENGL
000004 MFUSER ENGL
000005 BPRASANNA COMP
000006 BEEBOP PHYC
000007 SHEKAR ENGL
000008 KOLUSU COMP
000009 FRANK ENGL
000010 MFUSER ENGL
000011 BPRASANNA COMP
000012 BEEBOP PHYC
000013 SHEKAR ENGL
000014 KOLUSU COMP
000015 FRANK ENGL
000016 MFUSER ENGL
000017 BPRASANNA COMP
000018 BEEBOP PHYC
000019 SHEKAR ENGL
000020 KOLUSU COMP
000021 FRANK ENGL
000022 MFUSER ENGL
000023 BPRASANNA COMP
000024 BEEBOP PHYC
000025 SHEKAR ENGL
000026 KOLUSU COMP
000027 FRANK ENGL
000028 MFUSER ENGL
000029 BPRASANNA COMP
000030 BEEBOP PHYC
000031 SHEKAR ENGL
000032 KOLUSU COMP
000033 FRANK ENGL
000034 MFUSER ENGL
000035 BPRASANNA COMP
000036 BEEBOP PHYC
000037 SHEKAR ENGL
000038 KOLUSU COMP
000039 FRANK ENGL
000040 MFUSER ENGL
000041 BPRASANNA COMP
000042 BEEBOP PHYC
000043 SHEKAR ENGL
000044 KOLUSU COMP
000045 FRANK ENGL
000046 MFUSER ENGL
000047 BPRASANNA COMP
000048 BEEBOP PHYC
000049 SHEKAR ENGL
000050 KOLUSU COMP
|
OUTPUT DATASET
Code: |
SHEKAR.TEST.OUT
000001 KOLUSU COMP
000002 FRANK ENGL
000003 MFUSER ENGL
000004 BPRASANNA COMP
000005 BEEBOP PHYC
000006 SHEKAR ENGL
000007 KOLUSU COMP
000008 FRANK ENGL
000009 MFUSER ENGL
000010 BPRASANNA COMP
000011 BEEBOP PHYC
000012 SHEKAR ENGL
000013 KOLUSU COMP
000014 FRANK ENGL
000015 MFUSER ENGL
000016 BPRASANNA COMP
000017 BEEBOP PHYC
000018 SHEKAR ENGL
000019 KOLUSU COMP
000020 FRANK ENGL
000021 MFUSER ENGL
000022 BPRASANNA COMP
000023 BEEBOP PHYC
000024 SHEKAR ENGL
000025 KOLUSU COMP
|
_________________ Shekar
Grow Technically |
|
Back to top |
|
 |
shekar123 Advanced
Joined: 22 Jul 2005 Posts: 528 Topics: 90 Location: Bangalore India
|
Posted: Wed Jun 21, 2006 6:22 am Post subject: |
|
|
Beep_Bop,
You can also try this code using IDCAMS utilty which will also yield the same results.As you want to start from 764173 rec so use SKIP (764173 - 1 = 764172) and you want till the end of the file so COUNT (1890000 - 764172 = 1125828 ) which will total out (764172 + 1125828 = 1890000 records.Hope this helps.
Code: |
//STEP010 EXEC PGM=IDCAMS
//INFILE DD DSN=SHEKAR.TEST.IN,DISP=SHR
//OUTFILE DD DSN=SHEKAR.TEST.OUT,DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSIN DD *
REPRO INFILE(INFILE) -
OUTFILE(OUTFILE) -
SKIP(764172) -
COUNT(1125828)
/*
//
|
_________________ Shekar
Grow Technically |
|
Back to top |
|
 |
Bee_bop Beginner
Joined: 12 Dec 2005 Posts: 29 Topics: 15 Location: Singapore
|
Posted: Wed Jun 21, 2006 6:25 am Post subject: |
|
|
Thanks guys for the help got it now.
Regards,
Bee_bop |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Wed Jun 21, 2006 10:17 am Post subject: |
|
|
Quote: | Could you provide me with specific JCL ? I have dataset with PS dsorg
and contains 1890000 lines and I want to copy only from 764173 to
1890000 lines. |
Here are two different ways to do this with DFSORT:
Method 1: with OUTFIL STARTREC
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL STARTREC=764173
/*
|
Note that since you want to copy to the end of the input file, you don't need ENDREC.
Method 2: with SKIPREC
Code: |
//S2 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY,SKIPREC=764172
|
Note that since you want to copy to the end of the input file, you don't need STOPAFT. _________________ 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 |
|
 |
|
|