View previous topic :: View next topic |
Author |
Message |
ranga_subham Intermediate
Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Tue Feb 22, 2011 5:38 am Post subject: How to copy remaining records to output dataset with IDCAMS |
|
|
Hi,
We have a file with 100015 records - keeps varying depending on external feed. Our batch job makes use of SORT with STARTREC and ENDREC (SAVE feature too) to split it into three files for three downstream jobs. Now, We don't have SORT available for few days due to licence expiration issues. We are asked to use IDCAMS with REPRO for the same.
Can you please help how to save the remaining records (last set of records) to third file?
Thanks. _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
|
ranga_subham Intermediate
Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Tue Feb 22, 2011 5:40 am Post subject: |
|
|
I have tried using REPRO without COUNT but it ends with MAXCC=12 _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Feb 22, 2011 7:27 am Post subject: |
|
|
well,
a quick manual search (about 10 seconds) turned-up this link to IDCAMS Repro, Optional Parameters which indicate a FROM(number) and a SKIP(number).
I leave it to you to show us the results of your developed control cards. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
ranga_subham Intermediate
Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Tue Feb 22, 2011 8:52 am Post subject: |
|
|
I've tried the REPRO with FROMNUMBER and TONUMBER but it ends with MAXCC=12 because my input file is a flat file and not an RRDS _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Feb 22, 2011 9:34 am Post subject: |
|
|
well since you seem limited in you ability to try things new,
how about a combination of COUNT and SKIP? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
ranga_subham Intermediate
Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Tue Feb 22, 2011 9:45 am Post subject: |
|
|
Yes, that worked for first set but how about the remaining records? It fails only for the last option ! _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Feb 22, 2011 9:57 am Post subject: |
|
|
????
FIRST ds:
count(a)
SECOND ds:
skip(a)
count(b)
third ds:
skip(a+b)
why use a count for the third set? _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Feb 22, 2011 10:24 am Post subject: |
|
|
TTGI.BRENHOD.REPROIN is a 31 record dataset.
Code: |
//STEP010 EXEC PGM=IDCAMS
//INSET1 DD DSN=TTGI.BRENHOD.REPROIN,
// DISP=SHR
//OUTSET1 DD DSN=TTGI.BRENHOD.REPROO1,
// DISP=SHR
//OUTSET2 DD DSN=TTGI.BRENHOD.REPROO2,
// DISP=SHR
//OUTSET3 DD DSN=TTGI.BRENHOD.REPROO3,
// DISP=SHR
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
REPRO -
INFILE(INSET1) -
OUTFILE(OUTSET1) -
COUNT(10)
REPRO -
INFILE(INSET1) -
OUTFILE(OUTSET2) -
SKIP(10) -
COUNT(10)
REPRO -
INFILE(INSET1) -
OUTFILE(OUTSET3) -
SKIP(20)
/*
|
this is the output of the run:
Code: |
IDCAMS SYSTEM SERVICES TIME: 15:18:05
REPRO -
INFILE(INSET1) -
OUTFILE(OUTSET1) -
COUNT(10)
IDC0005I NUMBER OF RECORDS PROCESSED WAS 10
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
REPRO -
INFILE(INSET1) -
OUTFILE(OUTSET2) -
SKIP(10) -
COUNT(10)
IDC0005I NUMBER OF RECORDS PROCESSED WAS 10
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
REPRO -
INFILE(INSET1) -
OUTFILE(OUTSET3) -
SKIP(20)
IDC0005I NUMBER OF RECORDS PROCESSED WAS 11
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
IDC0002I IDCAMS PROCESSING COMPLETE. MAXIMUM CONDITION CODE WAS 0
|
i have not used idcams in 25 years. used the jcl in the examples,
strained my brain to figure out how to use skip and count,
and wonder of wonders -- it worked.
_________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
ranga_subham Intermediate
Joined: 31 Jan 2006 Posts: 255 Topics: 72
|
Posted: Tue Feb 22, 2011 10:49 am Post subject: |
|
|
Oh Yeah.........Thanks a lot. I should've tried SKIP alone for last option........
One more thing, I've tried FROMNUMBER, FROMADDRESS and FROMKEY options but none works on a PS dataset _________________ Ranga
*****
None of us is as smart as all of us - Ken Blanchard |
|
Back to top |
|
|
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Tue Feb 22, 2011 1:17 pm Post subject: |
|
|
ranga_subham wrote: |
One more thing, I've tried FROMNUMBER, FROMADDRESS and FROMKEY options but none works on a PS dataset
|
yep, that's what the book says.
glad you were able to accomplish your work task.
til tomorrow. _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
|
|
|