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 to delete records using JCL

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

New User


Joined: 12 Apr 2005
Posts: 2

PostPosted: Tue Apr 12, 2005 4:26 pm    Post subject: How to delete records using JCL
Reply with quote

Hi

I have a input file from which I have to delete records using JCL.
The problem is I have to delete them in clusters i.e I have to delete from line 10 to 30 and again 40 to 60 so on

Can any anybody help me in this regard
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: Tue Apr 12, 2005 9:50 pm    Post subject:
Reply with quote

If you have z/OS DFSORT V1R5 PTF UQ95214 or DFSORT R14 PTF UQ95213 (Dec, 2004), you can use DFSORT's new IFTHEN and OVERLAY parameters to do what you want as shown below. If you have DFSORT, but you don't have the Dec, 2004 PTF installed, ask your System Programmer to install it (it's free). For complete details on all of the new DFSORT and ICETOOL functions available with the Dec, 2004 PTF, see:

www.ibm.com/servers/storage/support/software/sort/mvs/pdug/

Here's the DFSORT job. I assumed that your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
* Put 'K' in 81 and a seqnum in 82-89
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'K',82:SEQNUM,8,ZD)),
* If seqnum is 10-30, put 'D' in 81.
    IFTHEN=(WHEN=(82,8,ZD,GE,+10,AND,82,8,ZD,LE,+30),
      OVERLAY=(81:C'D')),
* If seqnum is 40-60, put 'D' in 81.
    IFTHEN=(WHEN=(82,8,ZD,GE,+40,AND,82,8,ZD,LE,+60),
      OVERLAY=(81:C'D'))
* Delete records with 'D' in 81.  Remove 'K' and seqnum.
  OUTFIL OMIT=(81,1,CH,EQ,C'D'),OUTREC=(1,80)
/*
Back to top
View user's profile Send private message
prash510

New User


Joined: 12 Apr 2005
Posts: 2

PostPosted: Fri Apr 15, 2005 2:40 pm    Post subject:
Reply with quote

Hi Frank,

Thank's for the reply it worked out very well
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 Sort Card to Remove Duplicate records... raj4neo SYNCSORT 0 Wed Jan 25, 2017 4:44 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts JCL to delete component in a package sundaram.naveen Compuware & Other Tools 14 Tue Nov 29, 2016 6:21 pm
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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