BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
SAS_Explorer
Obsidian | Level 7

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

1 ACCEPTED SOLUTION

Accepted Solutions
vivek_sas
Obsidian | Level 7

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

7 REPLIES 7
vivek_sas
Obsidian | Level 7

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

SAS_Explorer
Obsidian | Level 7

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

 

 

vivek_sas
Obsidian | Level 7

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

 

CaseySmith
SAS Employee

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.


Register today and join us virtually on June 16!
sasglobalforum.com | #SASGF

View now: on-demand content for SAS users

SAS_Explorer
Obsidian | Level 7

Hi @CaseySmith @vivek_sas,

 

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

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

 

Kind Regards,

SAS Explorer

 

SAS_Explorer
Obsidian | Level 7

Hi @CaseySmith, @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

vivek_sas
Obsidian | Level 7

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

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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