My code creates OLAP cube.
Before it creates OLAP cube it deletes it.
Everything is ok, when cube already exists.
When it doesn't exist error is generated like:
ERROR: The registration for cube TESTCUBE was not found on the metadata server.
it also makes macro variable syscc ne 0.
So i want to insert some "if-then" statement, which checks if cube already exists.
Anyone knows how to do that.
P.s. SBB don't bother suggesting searching for google or SAS sites. I had already done that.
Also useful to know would be these things:
1) Are you using OLAP cubes within the context of the BI Platform (also known as the SAS Platform for Business Analytics)???
2) Are you using a DI Studio job to build your OLAP cube?
3) Are you using code generated in OLAP Cube Studio to build your cube?
4) If you are using the BI Platform, do you have access to view the metadata definitions via SAS Management Console????
5) If you are not directly using the SAS BI Platform or DI Studio and/or OLAP cube studio, are you perhaps using a product called Futrix and using OLAP cubes under that context????
Finally, this is probably not the best forum to post OLAP questions. You may find some OLAP cube users/builders here, but most OLAP cubes these days are used/built/maintained under the context of the BI Platform and most of those folks can be found in the Web Report Studio forum.
I am using SAS code like, which can be generated from OLAP Cube Studio.
The code is submited in SAS batch mode.
I don't understand why the code is needed? I ask how to check if cube exist, you ask me, how i create cubes.
The question is simple if there is any way, how to check if cube exist. It must be done with sas datastep functions.
More detail question is:
How to check if cube exist (is registered) on metadata server?
Ok, i also try to ask the same question in web report Studio.
exist function is for datasets/views/catalogs not for olap cube.
The way to check whether a cube exists might NOT be as simple as you suppose. It might NOT happen with Base SAS or Foundation SAS datastep functions. I believe you have to make a call to the metadata repository to check the existence of a cube.
For example, as you found out, the EXIST function checks for the existence of a SAS library member and your OLAP cube (depending on your configuration) may not be known by a library location, but instead might be known by a metadata repository location. Since this forum is for mostly "Base SAS" and Display Manager folks, there's not as much awareness of BI Platform maintenance issues or BI-related procedures.