The FPScript formulas build up a network where only the data flow is determined but not the control flow. This means that the order in which formulas are executed and if they are executed at all is not defined. Therefore, no operations, which have side effects on other objects are allowed in FPScript.
If you want to modify datasets or other objects, then you need to write a Visual Basic macro. Here you have full access rights to all object properties including the data of datasets.