BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Twinklex
Fluorite | Level 6
Hello,
I am using infile statement to trigger a script in Unix environment. Below is the code that I am using

data _null_;
infile "/unixlocation/filename.ksh" pipe;
input;
put _infile_;
run;

But to trigger the script (.ksh) file I need to use different credentials other than the ones used by my sas profile.
Can someone suggest me how to pass credentials to execute/run the script from Sas.
Any help would be appreciated. Thanks in advance.

I have already given a try using filename
But did not work.
1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

No. Even if you could manage to do it (and there are ways to do that), any competent system administrator will object to it, for good reasons. One simply does not put passwords on commandlines, as these are open to all users on the same system.

Maxim 14: Use the Right Tool. The proper tool for what you want to do is sudo, so use it.

View solution in original post

5 REPLIES 5
Kurt_Bremser
Super User

If you need to run a command from another user-id, have your UNIX admin enable this in sudo.

sudo can be set to allow you to run a certain command with a certain user without supplying credentials.

Twinklex
Fluorite | Level 6
Hello @Kurt_Bremser

That would be fine, but is there any possibility that I could assign the credentials from sas code. That helps very much.
Kurt_Bremser
Super User

No. Even if you could manage to do it (and there are ways to do that), any competent system administrator will object to it, for good reasons. One simply does not put passwords on commandlines, as these are open to all users on the same system.

Maxim 14: Use the Right Tool. The proper tool for what you want to do is sudo, so use it.

Twinklex
Fluorite | Level 6
Thanks
jimbarbour
Meteorite | Level 14

How would it be done from the command line if you needed different credentials?  However it is done from the command line is generally how it should be done in a FILENAME PIPE construct.

 

Jim

hackathon24-white-horiz.png

The 2025 SAS Hackathon Kicks Off on June 11!

Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.

YouTube LinkedIn

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 5 replies
  • 1255 views
  • 0 likes
  • 3 in conversation