BookmarkSubscribeRSS Feed
Aditi24
Obsidian | Level 7

Hi All,

 

SO currently I have been working on a SAS script where I have to get UserID and password through the below code:-

 

%let userid=;
%let pass = ; 

%MACRO login;
%WINDOW info
#1 @2 'QSP LOGIN:' attr=highlight
#5 @5 'Please enter userid:'
#5 @26 userid 20 attr=underline
#7 @5 'Please enter password:'
#7 @28 pass 20 attr=underline display=no;
%DISPLAY info;

%MEND login;
%login;

 

and the pass the obtained value of userid and password to another  macro which looks like this:-

 

%qspDataTransfer(
id=&userid
,password=&pass
,env=test
,study=0431
,comp=mk0431-sit1
,prot=abc
,filepath=/demo
,filename=py.sas7bdat
,PRS_program=TEST
,PRS_project=TEST_PROJECT
,email='aditi.singh@merck.com'
);

 

but this is giving error :

Apparent symbolic reference not resolved.

 

Please help!

6 REPLIES 6
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Wow, someone actually uses %window.  To be honest I wouldn't advise to do this, usernames & passwords are very delicate and belong to the user.  You would need to be extremely careful on each level to keep this secure and hidden, not easy if you passing it around in macro variables.  Consult with your IT group before attempting this, it is likely there are more secure and validated processes to extract data from a database (which is what you appear to be doing) then handling it yourself, such as encrypted login authentication files, secure portals etc.  If your program messes up and passwords appear in the log...

Aditi24
Obsidian | Level 7

All I want is to get the ID & password of the user (which they'll input) and propogate it further to a macro and then to a Java API. Please let me know if there is some other facility to do that. As of now I am trying to do this using %windows. I am a noob in SAS Macro porgramming.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

As I said, your best option will be to discuss this with your IT group and see what they can provide.  Its likely they can link the user directly in without further code.  Dealing with it yourself is quite dangerous.  Remember SAS creates a log file, if you take passwords and use them without anything further they can appear in the log - it just worries me that you might undermine the security of your whole system if you do not do these things properly.

jklaverstijn
Rhodochrosite | Level 12

On a side note you should keep an eye on the quoting of the password value. If passwords are complex (as they should be) they could easily contain characters that will throw off the execution of your code. Something like %NRBQUOTE() would make it more robust. So test your program with passwords that contain ampersands, punctuation, whitespace, single and double quotes as they are famous for causing havoc in SAS programs if not properly escaped. Just for fun try a password like the quote killer:

 

;*';*";*/;

 

Good luck,

- Jan.

Astounding
PROC Star

This seems like a long-shot ... but so does everything else.  I'm only suggesting it because your results indicate it's a possible cause.

 

You have two %LET statements at the beginning of your program.  By any chance, did the statements appear in a different order?  More specifically, did your program try to execute %qspDataTransfer before executing those %LET statements?

 

If that's not the case, we'll need to see the contents of %qspDataTransfer because there could be some other macro variable causing the problem (even a simple mis-spelling of a macro variable name).

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 6 replies
  • 2633 views
  • 1 like
  • 5 in conversation