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

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 5 replies
  • 558 views
  • 0 likes
  • 3 in conversation