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

How to delete records using JCL


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


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

PostPosted: Tue Apr 12, 2005 9:50 pm
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:

Use [URL] BBCode for External Links

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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 4
No new posts ICETOOL returns no records JCL & VSAM 1
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts DELETE SPUFI DB2 1
Search our Forums:

Back to Top