BookmarkSubscribeRSS Feed
SAS_user
Calcite | Level 5
Hi,
Need some help with olaps.

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.
6 REPLIES 6
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Given the statement: "My code"....

Suggest you share your code, ideally embedded in a SAS-generated log output to help forum readers to visualize / understand what your code is doing.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
try using "exist" function.
GL.
Cynthia_sas
SAS Super FREQ
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.

As for Googling to find out more information, the documentation for PROC OLAP is here (with examples):
http://support.sas.com/documentation/cdl/en/olapug/59574/HTML/default/viewer.htm#/documentation/cdl/...

cynthia
SAS_user
Calcite | Level 5
Cynthia

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.

sastech

exist function is for datasets/views/catalogs not for olap cube.
Cynthia_sas
SAS Super FREQ
Hi:
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.

If you want to check the existence of metadata objects, then I believe the way to do that is through the use of calls to the metadata using the special DATA step functions designed for use with metadata objects, as described here:
http://support.sas.com/documentation/cdl/en/lrmeta/60739/HTML/default/viewer.htm#/documentation/cdl/...

For more specific help with these datastep functions, you might want to open a track with SAS Tech Support.


cynthia
SAS_user
Calcite | Level 5
Thank you, Cynthia,

Yes, using these functions, and a help from some resources i managed to check if cube exist.
Of course first we have to place so metadata options.
The example is here:

data _null_;
rc=metadata_getnobj("omsobj:Cube?@Name='"||"&cube_name"||"'",1,uri);
put uri;
run;

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 1804 views
  • 0 likes
  • 4 in conversation