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

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


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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
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 Developer


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

PostPosted: Mon Apr 11, 2005 10:16 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 4
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts DELETE SPUFI DB2 1
Search our Forums:

Back to Top