Epoch
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
 
 

Display results as :
 


Rechercher Advanced Search

Keywords

Latest topics
» SAS Macro: Convert numbers (e.g., 1000) to names (e.g., One thousand)
%SYSGET to hide information EmptyMon Jun 10, 2013 2:57 pm by Admin

» SAS Enterprise Guide: Explore Data before you start Analysing
%SYSGET to hide information EmptyMon Jun 10, 2013 2:53 pm by Admin

» Predictive Analytics
%SYSGET to hide information EmptyFri May 31, 2013 3:30 pm by Admin

» Creating Frequency Report and Creating User Defined styles in SAS Add-In for Microsoft Office
%SYSGET to hide information EmptyTue Oct 23, 2012 2:11 pm by pallav

» Prompted Reports in BI Dashboard
%SYSGET to hide information EmptyThu Oct 11, 2012 4:54 pm by kushal

» Free SAS Webinar : Getting Started with SAS Hash Object
%SYSGET to hide information EmptyWed Oct 10, 2012 6:08 pm by pallav

» Which SAS procedure changes the name of a permanent format for a variable stored in a SAS data set?
%SYSGET to hide information EmptyTue Oct 02, 2012 12:47 am by rajin_kumar@yahoo.com

» What is written to SAS Log?
%SYSGET to hide information EmptyTue Oct 02, 2012 12:39 am by rajin_kumar@yahoo.com

» SAS Portal and BI Dashboard: Customizing the Tabs
%SYSGET to hide information EmptyTue Oct 02, 2012 12:33 am by kushal

Affiliates
free forum


%SYSGET to hide information

Go down

%SYSGET to hide information Empty %SYSGET to hide information

Post  pallav Thu May 17, 2012 1:35 pm

Do you know that you can hide certain macro variable value from other users....


%SYSGET:The macro function sysget returns the value of an environment variable.

You can create an environment variable in operating system which will be available to particular user only. This environment variable value can be call by user using %SYSGET.

How to create environment variable:


To add or change the values of environment variables

1.Open System in Control Panel.

2.On the Advanced tab, click Environment Variables, then click the name of the user variable or system variable you want to change, as follows.

Click:
• New to add a new variable name and value.
• Edit to change a current variable name and value.
• Delete to remove a variable name and value.

Note

•If you are not logged on as administrator to the local computer, the only environment variables you can change are user variables.
•To open System, click Start, click Control Panel, click Performance and Maintenance, and then click System.
•Windows saves changes in the registry so they are available automatically the next time you start your computer.
•You might have to close and reopen running programs for the new settings to take effect.

How this can be useful for SAS Programmer

Lets say SAS Programmer have written a program to connect SAS with oracle to access data from database.

Syntax for connecting SAS to Oracle is

Libname oralib oracle user = user_name password= abcd;

Proc print data = oralib.Data;
Run;


Some time you might needs to share programm with other users, which might lead to exposing of your username and password for oracle database to other user.

If you want to prevent this, create user define environment variable as mentioned in above steps.

first create user_name & password environment variable in operating system then use %SYSGET to fetch information about your username and password from system and save your username and password from other user.

Libname oralib oracle user = %sysget(user_name)
password= %sysget(password);

*here user_name and password are environment variable;
Proc print data = oralib.Data;
Run;

Now you are safe.......



Reply if you like..... Smile





pallav

Posts : 98
Join date : 2012-03-14
Location : Ahmedabad

Back to top Go down

Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum