06-06-2016 09:22 AM - edited 06-06-2016 09:28 AM
SO currently I have been working on a SAS script where I have to get UserID and password through the below code:-
%let pass = ;
#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;
and the pass the obtained value of userid and password to another macro which looks like this:-
but this is giving error :
Apparent symbolic reference not resolved.
06-06-2016 09:29 AM - edited 06-06-2016 09:30 AM
06-06-2016 09:34 AM
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...
06-07-2016 03:51 AM - edited 06-07-2016 03:55 AM
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.
06-07-2016 04:18 AM
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.
06-06-2016 10:56 AM
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:
06-06-2016 11:01 AM
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).