BookmarkSubscribeRSS Feed

Loading Data to Visual Analytics with Base SAS Code

Started ‎04-16-2020 by
Modified ‎04-16-2020 by
Views 2,840

Loading a SAS dataset to the LASR Analytic Server for access via Visual Analytics can be easily completed in the Visual Analytics point-and-click interface. But you can also load a dataset using base SAS code. There is a simple flow seen below to use code:




Note that the order of the steps are important, for instance, SAS will produce an error if you attempt to load a dataset to LASR that already exists on LASR. For the example below we assume variable assignments for a typical SAS installation, inserting your own web server URL. Things like port numbers and metadata library information may need to be changed. This example will load the CLASS dataset from the SASHELP library.


/* Connect to LASR */
libname lasrtemp tag=vapublic port=10031 host="" signer=;

/* Drop table that will be created */
proc sql noprint;
   drop table lasrtemp.class;

/* Remove any underlying table Metadata - not necessary, but a good practice */
proc metalib;
   omr (library = "/Shared Data/SAS Visual Analytics/Public/Visual Analytics Public LASR"
        repname = "Foundation"
   select = ("class");
   update_rule = (delete);

/* Create table in LASR */
data lasrtemp.class;
   set sashelp.class;

/* Create table Metadata */
proc metalib;
   omr (library = "/Shared Data/SAS Visual Analytics/Public/Visual Analytics Public LASR"
        repname = "Foundation"
   select = ("class");

Once you have loaded your data using the above code, it will be available for use in SAS Visual Analytics. In SAS Visual Analytics, Navigate to the Report Designer Page. Now select the Data tab and then click Add Data Source. Your newly loaded data should be available in the pop-up.




Version history
Last update:
‎04-16-2020 04:36 PM
Updated by:



Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

Free course: Data Literacy Essentials

Data Literacy is for all, even absolute beginners. Jump on board with this free e-learning  and boost your career prospects.

Get Started

Article Tags