Desktop productivity for business analysts and programmers

Adding Data to LASR Server

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 16
Accepted Solution

Adding Data to LASR Server

[ Edited ]

Hi Community,

 

I'm trying to load an ODBC Table to the LASR Server by applying User-Define Formats.

 

When I'm using LIBNAME statement and adding the table, it is executing successfully but I'm unable to see the table under "SAS Public LASR Server Library"

LIBNAME LASRLIB SASIOLA  TAG=VAPUBLIC  PORT=10031 HOST="sasteam.sas.com"  
SIGNER="http://sasteam.sas.com:80/SASLASRAuthorization" ;
data LASRLIB.INRTable;
   set foart.test;
run;

URL I'm referring is:

http://support.sas.com/documentation/cdl/en/inmsref/67213/HTML/default/viewer.htm#n1jgmliuih8n3xn1rm...

 

Regards,

SAS Explorer


Accepted Solutions
Solution
‎05-23-2016 03:25 AM
Occasional Contributor
Posts: 14

Re: Adding Data to LASR Server

Hi

In the above dataset program you already created table in laser library.Now you need to register it to sas va.
In the below code use your table in select clause which is highlited below and then specify va folder path where you want to store that data.

 

 

 

/* Register Table Macro */
%macro registertable( REPOSITORY=Foundation, REPOSID=, LIBRARY=, TABLE=, FOLDER=, TABLEID=, PREFIX= );
   %if %symexist(LASTSTEPRC) %then %do;
      %if %eval(&LASTSTEPRC. <= 4) %then %do;
         /* 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 ('InrTable');
            run;
            quit;
      %end;
   %end;
%mend;
%registerTable(
     LIBRARY=%nrstr(/Shared Data/SAS Visual Analytics/Public/Visual Analytics Public LASR)
   , FOLDER=%nrstr(Specify VA FOLDER PATH HERE)
   );

 

View solution in original post


All Replies
Occasional Contributor
Posts: 14

Re: Adding Data to LASR Server

You Should register the table.

Use the below code 

 

%macro registertable( REPOSITORY=Foundation, REPOSID=, LIBRARY=, TABLE=, FOLDER=, TABLEID=, PREFIX= );
%if %symexist(LASTSTEPRC) %then %do;
%if %eval(&LASTSTEPRC. <= 4) %then %do;
/* 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 ('TABLE NAME');
run;
quit;
%end;
%end;
%mend;
%registerTable(
LIBRARY=%nrstr(/Shared Data/SAS Visual Analytics/Public/Visual Analytics Public LASR)
, FOLDER=%nrstr(/USER/DATA)
);

Occasional Contributor
Posts: 16

Re: Adding Data to LASR Server

Hi @vivek_sas,

 

I'm pretty new to SAS Programming, I've few questions:

1) Where I've to modify to specify the ODBC Library table in the given snippet?

2) Where I've to add my "User-Defined Format" code in the given snippet?

3) How to use the given Macro?

 

Kind Regards,

SAS Explorer

 

 

Solution
‎05-23-2016 03:25 AM
Occasional Contributor
Posts: 14

Re: Adding Data to LASR Server

Hi

In the above dataset program you already created table in laser library.Now you need to register it to sas va.
In the below code use your table in select clause which is highlited below and then specify va folder path where you want to store that data.

 

 

 

/* Register Table Macro */
%macro registertable( REPOSITORY=Foundation, REPOSID=, LIBRARY=, TABLE=, FOLDER=, TABLEID=, PREFIX= );
   %if %symexist(LASTSTEPRC) %then %do;
      %if %eval(&LASTSTEPRC. <= 4) %then %do;
         /* 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 ('InrTable');
            run;
            quit;
      %end;
   %end;
%mend;
%registerTable(
     LIBRARY=%nrstr(/Shared Data/SAS Visual Analytics/Public/Visual Analytics Public LASR)
   , FOLDER=%nrstr(Specify VA FOLDER PATH HERE)
   );

 

SAS Super FREQ
Posts: 305

Re: Adding Data to LASR Server

If you have EG 7.1 or later, try out the "Upload to LASR" task, which both moves the data to LASR and registers it for use in SAS Visual Analytics.  Right-click the data set in the EG project tree or process flow that you wish to upload and select "Upload to LASR", then follow the simple wizard.

Occasional Contributor
Posts: 16

Re: Adding Data to LASR Server

[ Edited ]

Hi @CaseyS_SAS @vivek_sas,

 

I've tried as you suggested, both the solutions are working Smiley Happy

Thanks a lot to both of you for taking your time.

 

Kind Regards,

SAS Explorer

 

Occasional Contributor
Posts: 16

Re: Adding Data to LASR Server

Hi @CaseyS_SAS, @vivek_sas

 

When I'm trying to unload the table present in LASR Server using SAS EG, I'm getting the following Exception

ERROR: You are not licensed to start a LASR Analytic Server in this mode.

The statements are as follows:

LIBNAME LASRLIB SASIOLA  TAG=VAPUBLIC  PORT=10031 HOST="team.sas.com"  
SIGNER="http://team.sas.com:80/SASLASRAuthorization" ;

PROC LASR PORT=10031;
	REMOVE LASRLIB.INRFTABLE;
	PERFORMANCE HOST="team.sas.com" install="/opt/TKGrid";
run;

Guide me where I"m going wrong.

 

Kind Regards,

SAS Explorer

Occasional Contributor
Posts: 14

Re: Adding Data to LASR Server

@SAS_Explorer

 

Instead of Proc Lasr use Proc datasets to remove table it will work .

LIBNAME LASRLIB SASIOLA  TAG=VAPUBLIC  PORT=10031 HOST="team.sas.com"  
SIGNER="http://team.sas.com:80/SASLASRAuthorization" ;

 proc datasets library=lasrlib  nolist;

            delete inrtable;

        quit;

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 7 replies
  • 1142 views
  • 4 likes
  • 3 in conversation