DATA Step, Macro, Functions and more

Passing credentials to tcpunix.scr file

Posts: 71

Passing credentials to tcpunix.scr file



I am making a script in which the program have to store the credentials of the user so that is could be passed to a Java API for further execution. I am using the below script to get the input:-


%window info 
#1 @2 'MODSPACE LOGIN:' attr=highlight 
#5 @5 'Please enter userid:' 
#5 @26 user 20 attr=underline 
#7 @5 'Please enter password:' 
#7 @28 pass 20 attr=underline display=no; 

%display info; 

After that I have to call the tcpunix.scr file to login to the remote server. Now the script prompts its own authentication screen for input and I don't want that. I want the input that I've got using the above code to be passed to the script. Please let me know if there is a way. It will be much helpful.

Super User
Posts: 10,237

Re: Passing credentials to tcpunix.scr file

There are lines in the script file that use the input statement to obtain the credentials.

I would make a copy of the tcpunix.scr file that makes it easy (through comments) to identify those lines.

Then use a scripted editor to replace the lines with input with a type statement that supplies userid and password, and save to a new file.

Run that new script file when connecting.

Remove that script file immediately after signing off, for safety reasons.

Look if using proc pwencode makes sense to at least obscure the passwords.


I haven't found anything that lets the calling SAS process supply parameters to the scriptfile, or I would have used that.

Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation