|
|
| Author |
Message |
josephvincentd Warnings : 1 New User
Joined: 19 May 2005 Posts: 18
|
|
|
|
i have a question
that is
a ps or a pds member having 10 records.
and we dont know what are all the contents inside the file
i want to print 5th , 7th,10th
records in my spool with the use of JCL.(especially in jes2 environment)
is it possible?
can u help me to over come this....
thanks & regards
vincent. |
|
| Back to top |
|
 |
References
|
|
 |
Deepa.m Warnings : 1 Active User
Joined: 28 Apr 2005 Posts: 88
|
|
|
|
Is the total records only 10? is the records you want to print has any relation like want to print a record after every 2 records. does it have a common difference .. in that case u can use SAMPLE option
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL STARTREC=5,SAMPLE=2
/*
it filters the records starting from 5 ,8,10 etc.. |
|
| Back to top |
|
 |
MGIndaco
Moderator
Joined: 10 Mar 2005 Posts: 478 Location: Milan, Italy
|
|
|
|
Or... you can also use a IDCAMS as you can see below:
| Code: |
//DELETE EXEC PGM=IDCAMS
//SYSPRINT DD SYSOUT=*
//INP DD *
1
2
3
4
5
6
7
8
9
10
//OUT DD SYSOUT=*
//SYSIN DD *
REPRO INFILE(INP) OUTFILE(OUT) SKIP(4) COUNT(1)
REPRO INFILE(INP) OUTFILE(OUT) SKIP(6) COUNT(1)
REPRO INFILE(INP) OUTFILE(OUT) SKIP(9) COUNT(1) |
I think that for your request there are several solution. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Moderator
Joined: 15 Feb 2005 Posts: 4579 Location: San Jose, CA
|
|
|
|
Here's an example of a one pass DFSORT copy solution. I assumed your input file has RECFM=FB and LRECL=80, but you can change the job appropriately for other attributes.
| Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
01
02
03
04
05
06
07
08
09
10
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
* Add a seqnum.
INREC FIELDS=(1,80,81:SEQNUM,3,ZD)
* Include records 5, 7 and 10.
OUTFIL INCLUDE=(81,3,SS,EQ,C'005,007,010'),
* Remove seqnum.
OUTREC=(1,80)
/*
|
|
|
| Back to top |
|
 |
|
|
|