Can I affect a template that is being inherited from?

I've got a template A that is extending a parent template, B. There is some markup in B that I don't want rendered when I render A. Is there anything I can do in A to affect the output?

I've tried

{% set ... %}

and got an error that inheriting templates can only include {% block %} tags.

in template B {% block blockname %} this is not reader in template A{% endblock %}

in template A {% block blockname %}{% endblock %}