Search
 
 

Display results as :
 


Rechercher Advanced Search

Keywords

Affiliates
free forum


%SYSGET to hide information

View previous topic View next topic Go down

%SYSGET to hide information

Post  pallav on 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

View previous topic View next topic Back to top

- Similar topics

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