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 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 MXG - Processing Compressed DB2 SMF r... vasanthz All Other Mainframe Topics 2 Thu May 10, 2018 12:47 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Merge 2 records sancraig16 SYNCSORT 19 Tue Mar 27, 2018 8:17 pm
No new posts Copy set of records based on condition krish.deepu SYNCSORT 2 Thu Mar 08, 2018 11:39 am
No new posts add sequence number for duplicate rec... SRUTHI DRAVIDAMANI COBOL Programming 11 Thu Feb 22, 2018 5:37 pm

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