I'm full of suggestions - problem is I don't always work out if it's the best solution. But try this.
Create a secondary datasource xml file with a structure like below.
Then for the expression box value, select the program field/node from
record repeating group/node in the myDatasource secondary connection
with a filter where code field/node = value of the field/node which the
user has filled in called my:program from the 'Main data-source'.
<myDatasource>
<record>
<code>25</code>
<program>AT</program>
</record>
<record>
<code>26</code>
<program>BT</program>
</record>
<record>
<code>27</code>
<program>CT</program>
</record>
</myDatasource>
Look at the attached example. The secondary data-source has been included in the template as an included file.