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
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.
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.
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:
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.
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.
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
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.
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
See how to use one filter for multiple data sources by mapping your data from SAS’ Alexandria McCall.
Find more tutorials on the SAS Users YouTube channel.