Page 1 of 1

Delete a record in jcl

Posted: Tue Mar 29, 2016 7:17 am
by Venkyashwini
Hi,

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 ?

Posted: Tue Mar 29, 2016 12:01 pm
by William Collins
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.

Posted: Tue Mar 29, 2016 9:28 pm
by Venkyashwini
Thanks Collins

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

Posted: Thu Feb 09, 2017 2:00 pm
by Charinthara07