Desktop productivity for business analysts and programmers

Problem with sashelp.vcolumn in SAS EG

Reply
Contributor
Posts: 32

Problem with sashelp.vcolumn in SAS EG

Hello,

I try to obtain information about my sas data that are stored on a SAS server. I cannot understand what I am doing wrong. When I use the following code

 

proc sql;

   create table mytable as

     select * from sashelp.vcolumn

     where libname="RMTWORK";

quit;

*it worked;

 

But when I use the custom libname, the same code does not work. It appears to me that SAS EG cannot access see my library even it was successfully assigned.

 

 

libname SOD "/sas/sasusers/LLOUKINE/Sodium/Sodium 2016_2017/SASNielsenData/Nielsen 2016";

 

*NOTE: Libref SOD was successfully assigned as follows:

     Engine:       V9

     Physical Name: /sas/sasusers/LLOUKINE/Sodium/Sodium 2016_2017/SASNielsenData/Nielsen 2016

;

 

proc sql;

   create table mytable1 as

     select * from RTMSASHP.VCOLUMN

     where libname="SOD";

quit;

*it does not work. Table mytable1 is empty;

 

Why it did not work in SAS EG?

 Any idea why it does not work?

Thank you!

Esteemed Advisor
Posts: 7,294

Re: Problem with sashelp.vcolumn in SAS EG

What is: RTMSASHP.VCOLUMN?

 

and, while that probably should be sashelp.vcolumn, since you're using proc sql why access the view, just use:

  from dictionary.columns

 

HTH,

Art, CEO, AnalystFinder.com

 

Contributor
Posts: 32

Re: Problem with sashelp.vcolumn in SAS EG

sorry, I menat to sent this;

libname SOD "/sas/sasusers/LLOUKINE/Sodium/Sodium 2016_2017/SASNielsenData/Nielsen 2016";

*NOTE: Libref SOD was successfully assigned as follows:

Engine: V9

Physical Name: /sas/sasusers/LLOUKINE/Sodium/Sodium 2016_2017/SASNielsenData/Nielsen 2016

;

proc sql;

create table mytable1 as

select * from sashelp.vcolumn

where libname="SOD";

quit;

*it does not work. table mytable1 is empty. Why it did not work in SAS EG?;

 

at some point I noticed that SAS EG creates a libname called RTMSASHP, so itried to replace sashelp by RTMSASHP but it did not work anyway.

What I am trying to do is actually to read the names of files I have stored on a remote server, from the directory I point with the libname

 

Grand Advisor
Posts: 10,211

Re: Problem with sashelp.vcolumn in SAS EG


Lida wrote:

sorry, I menat to sent this;

libname SOD "/sas/sasusers/LLOUKINE/Sodium/Sodium 2016_2017/SASNielsenData/Nielsen 2016";

not work anyway.

What I am trying to do is actually to read the names of files I have stored on a remote server, from the directory I point with the libname

 


From a SAS veiwpoint LIBRARIES contain SAS files such as data sets, views and catalogs. If the file is not used by SAS then access through a LIBRARY statement in SAS does not exist.

You could use a directory listing command referenced as a FILENAME to pipe the results of LS or DIR or whichever and read that as if it were text file to import into a SAS data set.

There are also a number of SAS external file functions to explore such as DOPEN, DINFO, DREAD and such related to directory (folder) information.

Esteemed Advisor
Posts: 6,669

Re: Problem with sashelp.vcolumn in SAS EG

I guess that rtmsashp is a SAS/CONNECT remote reference to the server's sashelp?

I'm not surprised that the dynamically created dictionary tables don't work across that connection.

Run the query in an rsubmit and then download the resulting table.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Contributor
Posts: 32

Re: Problem with sashelp.vcolumn in SAS EG

how exactly canI do it?

 

Esteemed Advisor
Posts: 7,294

Re: Problem with sashelp.vcolumn in SAS EG

Out of curiosity, did you try:

 

proc sql;
  create table mytable1 as
    select * from dictionary.columns
      where libname="SOD"
  ;
quit;

Art, CEO, AnalystFinder.com

 

Contributor
Posts: 32

Re: Problem with sashelp.vcolumn in SAS EG

yes, I did, the file comes empty..

 

8070 GOPTIONS ACCESSIBLE;

8071

8072 proc sql;

8073 create table mytable1 as

8074 select * from dictionary.columns

8075 where libname="SOD"

8076 ;

NOTE: Table WORK.MYTABLE1 created, with 0 rows and 18 columns.

8077 quit;

NOTE: PROCEDURE SQL used (Total process time):

real time 0.01 seconds

cpu time 0.01 seconds

 

 

Ask a Question
Discussion stats
  • 7 replies
  • 133 views
  • 0 likes
  • 4 in conversation