Delete a record in jcl

In this Mainframe Forum - You can post your queries on JCL, OS/390 JCL, MVS JCL, z/OS JCL, JES2 & JES3

Moderators: Frank Yaeger, DikDude, Moderator Group

Post Reply
Posts: 2
Joined: Tue Mar 29, 2016 7:05 am

Delete a record in jcl

Post by Venkyashwini » Tue Mar 29, 2016 7:17 am


I'm having a flat file of LREC= 89. It is having a data of one table. let us assume that it is having Account number, status, acct_close_date,code.

1. The file is sorted based on account number in ascending and close_date in descending order. it will be looks like..

Acct status code acct_close_date
1 A aa (maximum date)
1 D bb (some date)
2 A cc (maximum date)
2 A dd (maximum date)

My question is I need to delete the 2nd record since it has Active account before that(1st record)...and I need to retain the 3rd and 4th row bcas both has close date as maximum date and they are active..

How to do it using JCL ?

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Tue Mar 29, 2016 12:01 pm

What do you mean by "JCL"? Just those lines that start "//" in column one? Nope, can't be done.

You presumably have a PS/flat file? How do you think you'd delete records from there? Nope, can't be done.

Of course, with SORT or another programming language and by creating a new output file with only the data you want, it can be done.

Posts: 2
Joined: Tue Mar 29, 2016 7:05 am

Post by Venkyashwini » Tue Mar 29, 2016 9:28 pm

Thanks Collins

Will it be possible by creating new o/p file.. if so can you please help me with this plzz. :?

Posts: 2
Joined: Thu Feb 09, 2017 1:57 pm

Post by Charinthara07 » Thu Feb 09, 2017 2:00 pm

Post Reply


Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Mainframe Interview questions

Other References
Mainframe Tools and others