Count the number of times that a single "-----------\n" separated record contains both "A=2" and "dummy=2" in compressed file "file.gz"
zcat file.gz | awk -v RS="-----------\n" '/A=2[ ,\n]/ && /dummy=2[ ,\n]/{count++} END{print "Final counter value=",count}'