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
 
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 Inefficient BUILD - VB records paddin... Daniel Prosser SYNCSORT 4 Thu Dec 14, 2017 3:52 pm
No new posts ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm

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