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
 

 

How do I delete some records from a file using a JCL

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

New User


Joined: 11 Apr 2005
Posts: 1

PostPosted: Mon Apr 11, 2005 12:24 pm    Post subject: How do I delete some records from a file using a JCL
Reply with quote

Hi,
I need a JCL which will delete first few records from a file and copy the rest to a new file. Please respond asap,
Thanks in Advance
Tridib
Back to top
View user's profile Send private message

thiru.guduru

New User


Joined: 06 Apr 2005
Posts: 9
Location: Bangalore

PostPosted: Mon Apr 11, 2005 2:10 pm    Post subject: Re: How do I delete some records from a file using a JCL
Reply with quote

use sort utility

//sysin dd *
sort fields=copy,skiprec=12
/*

This will skip the first 12 records in the input file and copies the remaining records to output file
Back to top
View user's profile Send private message
ynagabhushanrao

New User


Joined: 11 Apr 2005
Posts: 1

PostPosted: Mon Apr 11, 2005 2:22 pm    Post subject: Re: How do I delete some records from a file using a JCL
Reply with quote

//STEP01 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=test.test.input,DISP=SHR
//SORTOUT DD DSN=test.test.output,DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(2,1),RLSE),
// DCB=(LRECL=82,RECFM=FB,BLKSIZE=8200)
//SYSIN DD *
SORT FIELDS=COPY,
SKIPREC=2
END
/*
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: Mon Apr 11, 2005 10:16 pm    Post subject:
Reply with quote

Here's a DFSORT job that will delete the first 10 records from the input file and copy the rest to the output file:

Code:

//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN DD *
  OPTION COPY,SKIPREC=10
/*


The following will also work, although the previous form is preferred:

Code:

  SORT FIELDS=COPY,SKIPREC=10
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm


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