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

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

1 ACCEPTED SOLUTION

Accepted Solutions
kikorugeria
Fluorite | Level 6

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

6 REPLIES 6
ranjan7k
SAS Employee

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.

kikorugeria
Fluorite | Level 6

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
ranjan7k
SAS Employee

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.

SASKiwi
PROC Star

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.

Damo
SAS Employee

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

kikorugeria
Fluorite | Level 6

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.

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!

Tips for filtering data sources in SAS Visual Analytics

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.

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