I think you refer to the S-parameter file (SPOutput), not the dataset?
One possible solution is a build a composite filename that includes variable values, so that each name is different. You can use a variable filename with sprintf() function, as I showed in this
appnote
Applied to your case and assuming that w is an integer value (no decimal digits):
myfilename = sprintf("D:\abc
%i.s2p", w)
For w=10000, myfilename will then be "D:\abc10000.s2p"
Important: for the SPOutput block, you then specify FileName=myfilename
without enclosing myfilename in "".