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:
Regards,
SAS Explorer
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)
);
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)
);
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
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)
);
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
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
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
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;
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.