Using a macro for entries loop
You don't want braces within braces.

You want something like this instead:

{% set index = craft.entries.section(sectionName ~ 'Index').first %}


Same needs changing in the for loop.