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 Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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