jim wood wrote:
Now as things stand we create a new default for each of the dimensions a seperate non generic process. We would like to be able to copy all the subsets over to the new archive. As you'd imagine to do so we'd need a list of all the subsets to spool through, hence my question,
OK, I see where you're coming from now. The "generic" bit is the stumbling block.
I think you may be slightly screwed on creating a
completely generic process to be run entirely from within the server, but you may be able to come moderately close. The missing piece is of course the data directory. If you have that then WildcardFileSearch can do the rest, but it needs a starting point.
There's no native TI function which will return the data path as far as I know. The API can do it, a TI can't. You have the GetProcessErrorFileDirectory function which will return the output path which, by default, is the data directory but I don't know of anyone other than maybe one or two newbies who would allow log files to be mixed in with their data files. (On the other hand some of the tm1s.cfg files for the sample data directories seem to lack a LoggingDirectory parameter, as a result of which the log files go into the data directory. Just one more instance of showing that there are some, by no means all but some, at IBM who have not the first bleeping idea of how to run a TM1 instance out in the wild.)
Anyhow, the point is that there seems to be no function that will return that. I can understand this in a way since as noted previously you can in theory have multiple data folders for a server but an error logging path for a process must by definition be a single path. The absence of a GetServerDataFileDirectory function is therefore less surprising than it might seem.
Nor can I see a way of getting the path to the tm1s.cfg file, which you could parse to obtain that information.
Some, maybe many sites might have a system cube which stores this information, and indeed that's a good practice... but the odds are that no two system cubes will be designed alike so again, it's not a generic option. If Excel is installed on the server then it might have been possible to search the tm1p.ini file however the presence of Excel (or even Architect) on the server is never a given, and even if it was I've seen instances where the Perspectives data folder points to a different location from the actual data files. (Where the .xdis and .xrus are stored separately, for instance.)
What I'd do is to make the generic process have a parameter which receives the data directory. in theory that would require the user to enter it, but in practice you could write a wrapper process which calls your generic one. The wrapper process could pull the relevant path from the site's system cube as discussed above. (It may of course require you to implement one if the site doesn't have one.) This is as close as I think you can get to a true generic method.
The last thing that you need to be aware of is the aliases on the subsets. There's a SubsetAliasSet, but no corresponding SubsetAliasGet. Obviously if the .sub files were copied to another folder they could come across with the alias in place but that won't work as a real time thing because the dimensions will have been renamed under your method.
Once you know where the files are you could parse them to get the alias, but that's a significant amount of effort. But there's no way to read and recreate the subsets exactly as they were, alias and all, otherwise.