Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm
No new posts how to add the amount for duplicate r... SRUTHI DRAVIDAMANI COBOL Programming 6 Wed Feb 21, 2018 7:21 pm
No new posts Merging records, but not all the time prino DFSORT/ICETOOL 17 Sat Feb 17, 2018 4:20 pm
No new posts Need all records with high key kalidasvs SYNCSORT 15 Fri Feb 09, 2018 10:38 pm
No new posts Why is SORT rearranging records that ... cschablow DFSORT/ICETOOL 4 Wed Jan 24, 2018 10:14 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us