BookmarkSubscribeRSS Feed
GAIA
Calcite | Level 5

Hi Community,

 

 I'm using LIBNAME statement and datstep to load a Table to the LASR Server. The environment is distributed.

 

It is executing successfully (verified in the log), but I'm unable to see the table under "SAS Public LASR Server Library" 

 

Thanks a lot for all your help.

3 REPLIES 3
alexal
SAS Employee

@GAIA,

 

That's correct, you have to use proc metalib in order to register LASR table on the metadata server. Please see an example below:

 

/* Register Table Macro */
%macro registertable( REPOSITORY=Foundation, REPOSID=, LIBRARY=, TABLE=, FOLDER=, TABLEID=, PREFIX= );

/* Mask special characters */

   %let REPOSITORY=%superq(REPOSITORY);
   %let LIBRARY   =%superq(LIBRARY);
   %let FOLDER    =%superq(FOLDER);
   %let TABLE     =%superq(TABLE);

   %let REPOSARG=%str(REPNAME="&REPOSITORY.");
   %if ("&REPOSID." ne "") %THEN %LET REPOSARG=%str(REPID="&REPOSID.");

   %if ("&TABLEID." ne "") %THEN %LET SELECTOBJ=%str(&TABLEID.);
   %else                         %LET SELECTOBJ=&TABLE.;

   %if ("&FOLDER." ne "") %THEN
      %PUT INFO: Registering &FOLDER./&SELECTOBJ. to &LIBRARY. library.;
   %else
      %PUT INFO: Registering &SELECTOBJ. to &LIBRARY. library.;

   proc metalib;
      omr (
         library="&LIBRARY." 
         %str(&REPOSARG.) 
          ); 
      %if ("&TABLEID." eq "") %THEN %DO;
         %if ("&FOLDER." ne "") %THEN %DO;
            folder="&FOLDER.";
         %end;
      %end;
      %if ("&PREFIX." ne "") %THEN %DO;
         prefix="&PREFIX.";
      %end;
      select ("&SELECTOBJ."); 
   run; 
   quit;

%mend;

 

How to use this macro?

 

/* Synchronize table registration */
%registerTable(
     LIBRARY=%nrstr(/Shared Data/SAS Visual Analytics/Public/Visual Analytics Public LASR)
   , REPOSITORY=%nrstr(Foundation)
   , TABLE=%nrstr(<REPLACE_WITH_TABLE_NAME>)
   , FOLDER=%nrstr(/Shared Data/SAS Visual Analytics/Public/LASR)
   );

 

GAIA
Calcite | Level 5

@alexal

 

Thank you very much. This was very helpful.

Just an fyi, if TABLE name needs to be in a macro, it is better to use %str

 

Thank you once again.

 

 

/* Synchronize table registration */
%registerTable(
LIBRARY=%nrstr(/Shared Data/SAS Visual Analytics/Public/Visual Analytics Public LASR)
, REPOSITORY=%nrstr(Foundation)
, TABLE=%str(&Original_Table)
);

alexal
SAS Employee

@GAIA,

 

You are welcome. Do not forget to mark this question as resolved.

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!

Tips for filtering data sources in SAS Visual Analytics

See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 2183 views
  • 2 likes
  • 2 in conversation