Parsing record into multiple records in Shell Script

Hi, I am trying to parse a very long record in a text file into multiple records by checking ADD, DELETE, or MODIFY field value in a shell script.

Input
# File name xyz.txt
ADD|N000|8015662|DELETE|N001|9915662|MODIFY|N999|85678

Output
ADD|N000|8015662|
DELETE|N001|9915662|
MODIFY|N999|85678

I tried different techniques using awk, sed etc. But could not get the desired out. I would appreciate your help. Thanks

awk 'BEGIN {RS=ORS="|"}
  (NR > 1) && /ADD|MODIFY|DELETE/ { ORS="\n"; print ""; ORS="|" }
  1
' file1

ADD|N000|8015662|
DELETE|N001|9915662|
MODIFY|N999|85678

Thanks a lot. I works. If you do not mind can you please explain the code.

# Set the input (RS) and output record (ORS) separators to | (normally a newline)
awk 'BEGIN {RS=ORS="|"}
# If the record is ADD, MODIFY or DELETE print a newline (we didn't print the ADD, etc. yet)
# (the ORS hss to be changed temporarily, otherwise print "" will print a | now)
# and skip the first record (NR > 1) as you don't want a blank line at the start
   (NR > 1) && /ADD|MODIFY|DELETE/ { ORS="\n"; print ""; ORS="|" }
# 1 is shorthand for {print} (to print the record (ADD, etc.) (the detault action is to print when a codition is true.  1 always evaluates to true))
   1
' file1

Thanks for your time and effort to get the things straight

awk 'BEGIN {RS=ORS="|"} {print /ADD|MODIFY|DELETE/?"\n"$0:$0}' xyz.txt

perl:

my $str="ADD|N000|8015662|DELETE|N001|9915662|MODIFY|N999|85678";
my @tmp = split(/[|](?=(?:DELETE)|(?:MODIFY))/,$str);
print join "\n", @tmp;

By Sed:

 sed  's/ADD\|DELETE\|MODIFY/\n&/g' xyz.txt
$sed -e 's/ADD/\n&/g'  -e 's/DELETE/\n&/g' -e 's/MODIFY/\n&/g'
ADD|N000|8015662|DELETE|N001|9915662|MODIFY|N999|85678

ADD|N000|8015662|
DELETE|N001|9915662|
MODIFY|N999|85678