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

How Do I Programatically Unload and Load a LASR Table?

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

How Do I Programatically Unload and Load a LASR Table?

Hi,

 

I would like to create a SAS code that will unload a LASR table and reload it after. This is for updating the contents of the table. I have the hostname, port, user and password of both the physical and meta server. (Not sure if necessary. Maybe to setup the library where the table is located.)

 

So my desired output would be an unloaded/loaded LASR table when the code is run. Any ideas?

 

Thanks in advance!

 

Versions: SAS 9.4, SAS VA 7.3


Accepted Solutions
Solution
‎01-22-2017 08:09 PM
New Contributor
Posts: 3

Re: How Do I Programatically Unload and Load a LASR Table?

Hi everyone,

 

Thanks for your replies. I found the solution through going to VA > Administrator. Click on File > Preference. Under SAS Visual Analytics Administrator > Manage Environment, tick the checkbox beside Record Actions as SAS Statements.

 

Then, perform whatever you need in the GUI and the code will be saved in /tmp. You may manually change the code as needed.

 

NOTE: Be careful on using this option. You may not want your /tmp folder to be flooded by sas files. You may want to uncheck this preference after getting what you need.

View solution in original post


All Replies
SAS Employee
Posts: 2

Re: How Do I Programatically Unload and Load a LASR Table?

I am providing here few basic snippet that can be used to built a macro as per your requirement.

 

To unload/delete the lasr table, PROC IMSTAT can be used in below way.

 

PROC IMSTAT;

        table <libref>.<lasr table>;

        droptable;

        run;

quit;

 

And to load it back use, PROC LASR.

 

PROC LASR add

      data = <libref>.<lasr table>

      port = <lasr port>

      noclass;

      performance host = "<lasr server host>";

run;

 

Hope this helps.

New Contributor
Posts: 3

Re: How Do I Programatically Unload and Load a LASR Table?

[ Edited ]

Hi @ranjan7k, Thanks for the reply!

 

The solution you sent is maybe for tables directly loaded to the public LASR server. My table is from MySQL registered through SAS Management Console. This may be the reason why it doesen't work. Please see the following logs:

 

NOTE: The DROP and KEEP statements are not supported in procedure steps in this release of the SAS System. Therefore, these
statements are ignored.
 
NOTE: You are trying to access a table in the TABLE statement that is not stored in the LASR Analytic Server. The IMSTAT procedure does not process data from non-LASR sources.
 
NOTE: PROCEDURE IMSTAT used (Total process time):
real time 0.08 seconds
cpu time 0.00 seconds
SAS Employee
Posts: 2

Re: How Do I Programatically Unload and Load a LASR Table?

It should not really matter what the source is as once registered to Metadata all are accessesd via a libref. As you asked for program to unload and load a LASR table, my assumption was whatever source you are loading from (be it SAS, Oracle, MySql), it is first loaded into LASR server and loaded tables registered in Metadata with the LASR library. If that would have been the case, the script need only the libref i.e., the LASR library to load and unload. In my case, LASR tables were registered in Metadata.

 

Will check if some other solution can come up for your requirement.

Respected Advisor
Posts: 3,063

Re: How Do I Programatically Unload and Load a LASR Table?

It appears you are trying to run PROC IMSTAT statements against a non-LASR library - IMSTAT is only for use on LASR libraries. Please post your log to clarify what you are doing. The default LIBREF for the Public LASR library is LASRLIB. You can also define your own LIBNAME pointing at a LASR library.

SAS Employee
Posts: 68

Re: How Do I Programatically Unload and Load a LASR Table?

Hi,

 

If you are on a non-distributed environment, it might be as simple as running a DATASETS procedure then a DATA STEP.
Please have a look at Loading and Unloading Tables for Non-Distributed Servers.

 

If you're talking about unloading and loading a table from/to memory, the LASR procedure should help you:

  Example 6: Unload a Table from Memory

  Example 4: Load a Table from Teradata to Memory (you can obviousy take out the Teradata part)

 

In addition, paper Tips and Techniques for Efficiently Updating and Loading Data into SAS® Visual Analytics should provide additional guidances.

 

Hope that helps.

Cheers,

Damo

Solution
‎01-22-2017 08:09 PM
New Contributor
Posts: 3

Re: How Do I Programatically Unload and Load a LASR Table?

Hi everyone,

 

Thanks for your replies. I found the solution through going to VA > Administrator. Click on File > Preference. Under SAS Visual Analytics Administrator > Manage Environment, tick the checkbox beside Record Actions as SAS Statements.

 

Then, perform whatever you need in the GUI and the code will be saved in /tmp. You may manually change the code as needed.

 

NOTE: Be careful on using this option. You may not want your /tmp folder to be flooded by sas files. You may want to uncheck this preference after getting what you need.

☑ This topic is SOLVED.

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

Discussion stats
  • 6 replies
  • 561 views
  • 0 likes
  • 4 in conversation