Help using Base SAS procedures

Distinguish a dataset from a cluster

Reply
New Contributor
Posts: 3

Distinguish a dataset from a cluster

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.
Super Contributor
Super Contributor
Posts: 3,174

Re: Distinguish a dataset from a cluster

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.
New Contributor
Posts: 3

Re: Distinguish a dataset from a cluster

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.
Super User
Posts: 10,044

Re: Distinguish a dataset from a cluster

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
Super Contributor
Super Contributor
Posts: 3,174

Re: Distinguish a dataset from a cluster

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
New Contributor
Posts: 3

Re: Distinguish a dataset from a cluster

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.
Valued Guide
Posts: 2,177

Re: Distinguish a dataset from a cluster

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
Super User
Posts: 10,044

Re: Distinguish a dataset from a cluster

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
New Contributor
Posts: 2

Re: Distinguish a dataset from a cluster

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!

Super User
Posts: 5,437

Re: Distinguish a dataset from a cluster

If you query SPD Server DICTIONARY.CLUSTERS you should avoid errors.
Data never sleeps
New Contributor
Posts: 2

Re: Distinguish a dataset from a cluster

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.

Super User
Posts: 5,437

Re: Distinguish a dataset from a cluster

Be sure to use explicit SQL pass through.
Check the documentation for details.
Data never sleeps
Ask a Question
Discussion stats
  • 11 replies
  • 317 views
  • 0 likes
  • 6 in conversation