IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

jcl to print 5,7,10th records in a ps


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
josephvincentd
Warnings : 1

New User


Joined: 19 May 2005
Posts: 15

PostPosted: Thu May 19, 2005 10:44 am
Reply with quote

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
View user's profile Send private message
Deepa.m

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Thu May 19, 2005 6:23 pm
Reply with quote

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
View user's profile Send private message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu May 19, 2005 6:37 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu May 19, 2005 9:33 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top