Exploring, predicting and reporting with SAS Visual Analytics and SAS Visual Statistics

Adding and registering table to LASR in SAS VA

Reply
New Contributor
Posts: 2

Adding and registering table to LASR in SAS VA

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.

SAS Super FREQ
Posts: 558

Re: Adding and registering table to LASR in SAS VA

@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)
   );

 

New Contributor
Posts: 2

Re: Adding and registering table to LASR in SAS VA

@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)
);

SAS Super FREQ
Posts: 558

Re: Adding and registering table to LASR in SAS VA

@GAIA,

 

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

Ask a Question
Discussion stats
  • 3 replies
  • 360 views
  • 2 likes
  • 2 in conversation