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 Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
No new posts Skip file from delete pema_yozer All Other Mainframe Topics 3 Tue Aug 29, 2017 3:19 pm
No new posts Join records from 2 files with No Dup... Poha Eater DFSORT/ICETOOL 21 Sun Aug 27, 2017 10:35 pm
No new posts Delete IMS remote transaction when MO... Sam Singh IMS DB/DC 0 Wed Aug 23, 2017 9:12 pm

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