BookmarkSubscribeRSS Feed
elDorado
Fluorite | Level 6
Hello,
Anyone know any way to distinguish a table from a cluster? I've tested functions, I considered the dictionary tables, already checked the proc contents and still can not find a way. The proc contents returns a report with information about the cluster members, but only appears in report, not appears in the table.

Thank you.
11 REPLIES 11
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
What do you consider to be a "cluster", please? What OS platform or DBMS or otherwise any attribute consistent with your environment. How do you access this "cluster" of information/data within your SAS session - share specific code as it appears in a SAS log execution, please.

Scott Barry
SBBWorks, Inc.
elDorado
Fluorite | Level 6
Hello. For me a cluster is a "dataset" but that is composed by several members, one member in this case corresponds to a year/month (example: cluster: sales; cluster members: sales_2010_01; sales_2010_02, etc. ...). The point is that in my case a cluster will have a different treatment of a dataset, then I want ditinguish them. I'm testing in Enterprise Guide 4.1 on windows xp and the DBMS is Informix. The cluster is accessed through aix and the libnames where are the clusters are SPDS.
I'm creating a process to copy all tables/clusters by libname to another libname in another machine, and i whant to distinguish a dataset from one cluster to see if unmount the cluster and copy the members or if I copy the dataset directly. My tables and clusters are redistributed by several libnames base and SPDS.

Thanks for the help.
Ksharp
Super User
Hi.
proc contents has a option (out=data_set) which you can use it.
and which tool you use to copy data. proc copy / proc cport ?
there is a statement ( select dataset1 dataset2....)( exclude dataset1 dataset2 )which can able you to select or exclude the dataset which you want.


Ksharp
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Also, suggest you look at the SAS-maintained DICTIONARY members using PROC SQL, or SASHELP.Vxxxxxx members using either a DATA step or possibly a PROC step. Analyze these members to identify / filter the specific SAS-accessed file(s) you might want to process, select, as required.

Scott Barry
SBBWorks, Inc.

Suggested Google advanced search arguments, this topic / post:

proc sql dictionary members site:sas.com

sashelp views site:sas.com
elDorado
Fluorite | Level 6
Hi.
I use proc copy in my process. As I have not found a way to distinguish a cluster from a dataset, did two independent processes, one to copy the clusters and other to copy the datasets. I used the statement (select dataset1 dataset2 ....)( exclude dataset1 dataset2) in proc copy and so I decided my problem, I select and delete the tables that I want to copy.

Thanks for the help.
Peter_C
Rhodochrosite | Level 12
glad you've got a solution.
I suffered a similar difficulty - from which path of a concatenated library does a table come.
No dictionary table answers that question - but PROC CONTENTS (and ODS ) to the rescue!
The information we want is produced by proc contents.
Although the OUT= and OUT2= tables do not provide the actual data I needed (path to the physical data), the ODS layer can create a data set of any table that proc contents reports.
For me it was the EngineHost table. For SPDS cluster information, the details may be created in a different table. I bet (beer at SAS Global Forum) you'll find any table of cluster information reported by proc contents can be written to a sas data set by using ODS output ...

good luck
peterC
Ksharp
Super User
Hi.Peter
My company has a Spd server under AIX os.
and in the AIX there is a file named libnames.parm(i.e. /sas/spds44/site/libnames.parm)
which contains the information you need,you can use vi/txt open it and distil the pathe. But before use it, recommend to backup it for the sake of importance.


Ksharp
cookdatasolutio
Fluorite | Level 6

Hi,

 

Sorry to dig up an old topic, but I was trying to do the same and this came up in my search results.  I eventually found a workaround that I thought was worth sharing.

 

If you were to run

 

proc spdo library=<LIB>;

    cluster list <TABLE>;

quit;

 

then if <TABLE> is a cluster, the macro &spdslist will be populated with a list of the members.  If <TABLE> is NOT a cluster, &spdslist is still created but will be blank, but unfortunately the procedure will error.  What I did was to redirect the log with proc printto statements immediately before and after proc spdo, to mask the error, then test the value of &spdslist to determine what to do next.  It's not the cleanest solution, but it worked for me!

LinusH
Tourmaline | Level 20
If you query SPD Server DICTIONARY.CLUSTERS you should avoid errors.
Data never sleeps
cookdatasolutio
Fluorite | Level 6

Thank you. That certainly sounds a neater way, although when I tried it I got the message that dictionary.clusters was not a valid dictionary table name.  Perhaps that's an issue with my current client's setup, but I'll certainly try it in future.

LinusH
Tourmaline | Level 20
Be sure to use explicit SQL pass through.
Check the documentation for details.
Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 11 replies
  • 1691 views
  • 0 likes
  • 6 in conversation