Hello everyone,
I would like to know if there is a way to hide a specific column from a dataset for certain users while keeping the same dataset accessible in SAS Enterprise Guide.
For example, can we prevent a user from viewing a sensitive column (like a salary or ID number) even though they have access to the dataset?
... View more
A SAS Viya Administration question that I have heard multiple times recently is whether it is possible to perform a partial backup and restore of a SAS Viya environment. In addition to hearing it from colleagues and customers, I also ran into a case where we needed to implement a partial backup in our internal reporting environment. Given the interest, I thought Communities post
... View more
I am using the following code to generate the box plot. However My carmodel with Red color have only one record. I want to display the patterns to every Blue and Green colors, but not for the 'Red' color group . Is there any way I can control it? thank you in advance.
/* Create dataset with 20 cars - Volvo/Fiat/Land Rover forced to Red */
data car_performance;
length CarModel $20 Color $10;
/* Define car models */
array car_models[20] $20 _temporary_ (
"Toyota Camry", "Honda Accord", "Ford Mustang", "Chevrolet Corvette",
"BMW M3", "Tesla Model S", "Audi A4", "Subaru Outback",
"Jeep Wrangler", "Porsche 911", "Lexus RX", "Hyundai Sonata",
"Volkswagen Golf", "Mazda CX-5", "Mercedes C-Class", "Nissan Altima",
"Kia Telluride", "Volvo XC90", "Land Rover Defender", "Fiat 500"
);
/* Define colors (Green replaces Silver) */
array colors[2] $10 _temporary_ ("Blue", "Green");
/* Generate data */
do i = 1 to 20;
CarModel = car_models[i];
/* Force Volvo, Fiat, Land Rover to Red */
if CarModel in ("Volvo XC90", "Fiat 500", "Land Rover Defender") then
Color = "Red";
/* Distribute others evenly between Blue/Green */
else
Color = colors[mod(i, 2) + 1];
/* Random MPG values (color-specific ranges) */
if Color = "Red" then
MPG = round(18 + 12 * ranuni(0)); /* Red: 18-30 MPG */
else if Color = "Blue" then
MPG = round(22 + 10 * ranuni(0)); /* Blue: 22-32 MPG */
else
MPG = round(25 + 8 * ranuni(0)); /* Green: 25-33 MPG */
output;
end;
drop i;
run;
data xx;
set car_performance;
if CARMODEL in ('Volvo XC90' 'Land Rover Defender') and color = 'Red' then delete;
run;
options orientation = landscape errors = 2 missing = ' ' nofmterr ls = 175 validvarname = upcase nobyline;
ods graphics on / attrpriority=none reset=all width=9.0in height=4.6in border=off;
ods escapechar = '^';
ods results on;
ods listing close;
ods rtf file = "C:\temp\test.rtf" ;
proc sgplot data=xx;
title "Car MPG Distribution by Color";
vbox MPG / category=Color
dataskin=none
fillpattern
lineattrs=(thickness=2);
/* Customize colors in the plot */
styleattrs datafillpatterns=(X1);
xaxis label="Car Color";
yaxis label="Miles Per Gallon (MPG)" grid;
run;
ods rtf close;
... View more
Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.