what is the program attribute in setparam element for?

Thats a good question. I believe it has to do with which shader to set it on. In case the same symbol is defined in multiple shaders used in the same effect.
I am not 100% sure about that but its my best guess.
It has to do with the difference between shader variables and effect variables. The newparam elements in CFX create effect variables only. But the setparam elements allow you to set either effect variables or shader variables. I believe the program attribute is there to specify which shader. It most likely references by sid like most other things in CFX

<effect>
  <include sid="source1" url="shader.cg"/>
  <include sid="source2" url="shader2.cg"/>
  <setparam ref="variablename" program="source1">
    <float>50</float>
  </setparam>
  ...

-Andy

That is definately the prefered way to do it.
But… If you are including a .cgfx as your shader code you may already have an effect variable declared in the file. Maybe you are supposed to use bind for all shader variables but can use setparam for effect variables declared within the source. It’s probaly not a good idea to have different sets of variables in two different files used for the same effect but it’s possible so maybe thats why it was designed that way.

-Andy