BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Criptic
Lapis Lazuli | Level 10

Hey,

 

I want to find the work directory of a specific user. I'm on SAS 9.4M2 and AIX 7.1. I have access to the directory on AIX where all the work directories are stored and I can see names like this one:

/work/SAS_work591503DB00F0_cdb2/SAS_workC10603DB00F0_cdb2 - This is my current work for example.

 

Is there a way to match this folder to my metauser?

 

Kind regards

David

 

P.S. I know about %sysfunc(getoption(work)) but I'm looking for something where I can add the parameter of a userId or proc options option=work;

1 ACCEPTED SOLUTION

Accepted Solutions
alexal
SAS Employee

@Criptic,

 

When you invoke SAS, it assigns the Work libref to a subdirectory of the directory specified in the WORK system option described in WORK System Option: UNIX. This subdirectory is usually named SAS_workcode_nodename, and has the following characteristics:

 

workcode
is a 12-character code. The first four characters are randomly generated numbers. The next eight characters are based on the hexadecimal process identification number of the SAS session.

 

nodename
is the name of the UNIX computer where the SAS process is running.

View solution in original post

12 REPLIES 12
nhvdwalt
Barite | Level 11

Depending on how your security is set up, the AIX user that owns that folder will be the user that's running the SAS jobs.

Criptic
Lapis Lazuli | Level 10

Thank you for your response.

 

Sadly the owner of the workfolder is a technical users, as the SAS-Users don't have profiles on the AIX

nhvdwalt
Barite | Level 11

Ok, try this....Its a bit manual, but it should do the trick...

 

Look at the name of the workspace directory and get the PID of the SAS process. In this case you will convert 00F0 from hex to decimal and get a process ID of 240. Look up this PID in the Object Spawer log to see if you can figure out for which client it was created. You might see the requesting client is the Technical User, but should also be able to get the SAS application and IP address that made the request.

nhvdwalt
Barite | Level 11

If you have Workspace Server logging enabled (that includes the PID in the log file name) you could also look at the %LET _CLIENTUSERID = 'xxx' value that SAS Enterprise Guide writes to the log. That could also help...

Criptic
Lapis Lazuli | Level 10

Thank you again for your time. I'm accepted a different answer as my solution as it was way easier to automate but thank you again for the effort and response!

boemskats
Lapis Lazuli | Level 10

Hi @Criptic

Sadly the owner of the workfolder is a technical users, as the SAS-Users don't have profiles on the AIX

Criptic
Lapis Lazuli | Level 10

Thank you for your reply.
I ran across your tool in another post on the forum. Your tool looks great but it is complete overkill for what I'm trying to achieve here.

boemskats
Lapis Lazuli | Level 10

Fair - I had to mention it 🙂

 

If you're scripting have a look at this bit of worktop specifically as it's one mechanism for metadata user identification at filesystem level:

 

https://github.com/Boemska/worktop#3-update-your-workspace-server-config

 

Nik

alexal
SAS Employee

@Criptic,

 

When you invoke SAS, it assigns the Work libref to a subdirectory of the directory specified in the WORK system option described in WORK System Option: UNIX. This subdirectory is usually named SAS_workcode_nodename, and has the following characteristics:

 

workcode
is a 12-character code. The first four characters are randomly generated numbers. The next eight characters are based on the hexadecimal process identification number of the SAS session.

 

nodename
is the name of the UNIX computer where the SAS process is running.

Criptic
Lapis Lazuli | Level 10

Thank you. This is perfect for what I'm trying to do.

alexal
SAS Employee

@Criptic,

 

You are welcome!

ronan
Lapis Lazuli | Level 10

Using the information provided above by @alexal and the SMC, Server plug-in monitoring feature, you can retrieve the information and join manually SAS Session PID and Work path :

 

https://support.sas.com/documentation/cdl/en/bisag/68240/HTML/default/viewer.htm#p0o497lmygjfrfn0z7t...

 

Automating this join shouldn't be unfeasible either :

 

https://blogs.sas.com/content/sasdummy/2016/02/15/using-proc-iomoperate/

 

 

 

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

Get Started with SAS Information Catalog in SAS Viya

SAS technical trainer Erin Winters shows you how to explore assets, create new data discovery agents, schedule data discovery agents, and much more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 12 replies
  • 2514 views
  • 3 likes
  • 5 in conversation