Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
josephvincentd
Warnings : 1

New User


Joined: 19 May 2005
Posts: 17

PostPosted: Thu May 19, 2005 10:44 am    Post subject: jcl to print 5,7,10th records in a ps
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
Warnings : 1

New User


Joined: 28 Apr 2005
Posts: 99

PostPosted: Thu May 19, 2005 6:23 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu May 19, 2005 9:33 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us