BookmarkSubscribeRSS Feed

Loading Data to Visual Analytics with Base SAS Code

Started ‎04-16-2020 by
Modified ‎04-16-2020 by
Views 3,246

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:

 

2020-04-16_14h21_26.png

 

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="url.com" signer=http://url.com:7980/SASLASRAuthorization;

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

/* 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);
run;

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

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

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.

 

va.png

 

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

SAS Innovate 2025: Register Now

Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
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