BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
PriitL
Obsidian | Level 7

Hi!

 

I have tried to find an answer to the question how to get all the system's variables from SASApp server from the Community and Google without luck.

For example, I can get STPWORK variable value with

data getenv;
  variable=sysget('STPWORK');
  put variable=;
run;

and it shows the real path to the folder on the server.

 

Is there any way to ask all the variables SASApp has currently applied?

 

The problem is, some process generate temporary files to the disk and I need to know what variable has the path to the problematic destination.

I could ask some other variables also but I don't know the variables names.

We have SAS 9.4M7 on Linux.

 

Thanks!

 

 

Priit L

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PriitL
Obsidian | Level 7

It's a shame that the topic of this thread is a little different from its content, but oh well, what to do when trying to solve the root cause from the other end. 🙂

 

Anyway, the issue where Libref=WORK generates temporary files to /tmp is resolved now. The correct place to set -WORK variable was

<sas-home>/SASFoundation/9.4/sasv9_local.cfg

 

<sas-home>/SASFoundation/9.4/sasv9.cfg has global variables for the system and for override there's a sasv9_local.cfg.

Adding the variable 

-WORK /opt/sas/<some-directory>

resolves the issue and temporary files are now where they should be. Setting the variable from SASApp_VA/sasv9_usermods.cfg doesn't work.

Which seems strange because if I hotfix/update/upgrade the system the file might be overritten with defaults and I event won't go there to modify the environment.

 

Oh, and it even doesn't need ObjectSpawner restart to apply.

 

Thanks to everyone who thought along.

 

 

View solution in original post

14 REPLIES 14
PriitL
Obsidian | Level 7

Thank You for Your reply.

 

Indeed, it ouputs some system variables, but unfortunately not the one I'm looking for.

It shows (for those who are curious)

APFMTLIB=SASEnvironment/SASFormats
BASH=/bin/bash
BASHOPTS=cmdhist:extquote:force_fignore:hostcomplete:interactive_comments:progcomp:promptvars:source
BASH_ALIASES=()
BASH_ARGC=()
BASH_ARGV=()
BASH_CMDS=()
BASH_EXECUTION_STRING=set
BASH_LINENO=()
BASH_SOURCE=()
BASH_VERSINFO=([0]="4" [1]="2" [2]="46" [3]="2" [4]="release" [5]="x86_64-redhat-linux-gnu")
BASH_VERSION='4.2.46(2)-release'
DIRSTACK=()
EUID=1000
GROUPS=()
HISTCONTROL=ignoredups
HISTSIZE=5000
HOME=/home/<username>
HOST=someserverhostname
HOSTNAME=someserverhostname.domain.dn
HOSTTYPE=x86_64
IFS=$' \t\n'
JAVA_HOME=/opt/sas/home/SASPrivateJavaRuntimeEnvironment/9.4/jre
LANG=en_US.UTF-8
LD_LIBRARY_PATH=/opt/sas/home/Secure/sasexe:/opt/sas/home/SASODBCDriversfortheWebInfrastructurePlatf
LESSOPEN='||/usr/bin/lesspipe.sh %s'
LOGNAME=<username>
LS_COLORS='rs=0:di=01;34:ln=01;36:mh=00:pi=40;33:so=01;35:do=01;35:bd=40;33;01:cd=40;33;01:or=40;31;
MACHTYPE=x86_64-redhat-linux-gnu
MAIL=/var/spool/mail/sas
METAPASS=AB8F7f082Cb6C22Fd1525564337f477c
METAUSER='<username>@!*(generatedpassworddomain)*!'
ODBCINI=/opt/sas/home/AccessClients/9.4/PostgreSQL/odbc.ini
OPTERR=1
OPTIND=1
OSTYPE=linux-gnu
PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/home/sas/.local/bin:/home/sas/bin
PGCLIENTENCODING=UTF8
PPID=19036
PS4='+ '
PWD=/opt/sas/config/Lev1/SASApp
SAMPSIO='(                  '\''!SASROOT/samples/accesssample'\''         '\''!SASROOT/samples/base'
SAMPsrc='(                  '\''!SASROOT/samples/accesssample'\''         '\''!SASROOT/samples/base'
SASAUTOS='(                  '\''!SASROOT/sasautos'\''         )'
SASCFGPATH='!SASROOT/sasv9.cfg, !SASROOT/nls/u8/sasv9.cfg, !SASROOT/sasv9_local.cfg,  /opt/sas/confi
SASHOME=/opt/sas/home
SASROOT=/opt/sas/home/SASFoundation/9.4
SAS_INSTALL_ROOT=/opt/sas/home/SASFoundation/9.4
SAS_ODSG_CRENDER_PATH=/opt/sas/home/SASODSGraphicsCRenderer/9.46
SERVER_PID_FILE_NAME=server.someserverhostname.pid
SHELL=/bin/bash
SHELLOPTS=braceexpand:hashall:interactive-comments
SHLVL=4
TERM=xterm
TKELS_HANDLE_PREFIX__SAS_SOCKET=0005
TKSECURE_USE_SPNEGO=true
TK_Default_Options=
TK_PATHLIST=/opt/sas/home/SASFoundation/9.4/sasexe:/opt/sas/home/SASFoundation/9.4/utilities/bin
UID=1000
USER=<username>
XDG_SESSION_ID=30265
_=/bin/bash

 

I'm looking for some variables which point to /tmp but probably it uses some system "global" variables for temporary files.

I'm aware it would help a lot if the names for those space consuming files/directories would be known but at the moment it is not known.

 

I also asked the user to do the same procedure to bring out the same behavior again, but she already fixed some data/steps in the procedure and it's not worth messing it up again.

 

PriitL
Obsidian | Level 7

Oh, and at first I got an error:

ERROR: Insufficient authorization to access PIPE.

In that case I had to "Allow XCMD" from Management Console (Server Manager -> SASApp -> SASApp - Logical Workspace Server -> SASApp - Workspace Server (properties) -> Options tab -> Advanced Options -> Launch Properties tab.

 

 

 

 

Reeza
Super User

XCMD allows users to interface with the OS and use OS commands. That's usually a feature turned off on EG for security reasons.

 


@PriitL wrote:

Oh, and at first I got an error:

ERROR: Insufficient authorization to access PIPE.

In that case I had to "Allow XCMD" from Management Console (Server Manager -> SASApp -> SASApp - Logical Workspace Server -> SASApp - Workspace Server (properties) -> Options tab -> Advanced Options -> Launch Properties tab.

 

 

 

 


 

PriitL
Obsidian | Level 7

The variable STPWORK is already set up <Lev1>/SASApp_VA/sasv9_usermods.cfg file. I know for sure it was set on August and later there has been restarts to the same server's ObjectSpawner. Still, there are some directories on the /tmp folder created even today. The names are like "SAS_util000100011FDC_sasva2" and "SAS_work42DF00011FDC_sasva2".

Luckily, as there are previously mentioned directories, lsof shows the process number and it is a child process of ObjectSpawner:

 

$ lsof | grep /tmp/SAS_work42DF00011FDC_sasva2/
sas 73692 sassrv 21uW REG 253,0 0 16778272 /tmp/SAS_work42DF00011FDC_sasva2/sas.lck

$ ps axfu
[--8<--]
sas 72258 0.0 0.0 113288 1488 ? S Sep14 0:00 /bin/sh -p /opt/sas/config/Lev1/ObjectSpawner2/ObjectSpawner.sh start2_tag sas 72268 0.0 0.0 880496 23832 ? Sl Sep14 0:06 \_ /opt/sas/home/SASFoundation/9.4/utilities/bin/objspawn -dnsmatch somehost.domain.dn -sspi -sasSpawnerCn Object Spawner 2 - sasva2 -xmlconfigfile /op root 72269 0.0 0.0 21504 1328 ? S Sep14 0:00 \_ sasels 7 4 8 2 f5019 root 72280 0.0 0.0 70540 2716 ? Ss Sep14 0:00 \_ /opt/sas/home/SASFoundation/9.4/utilities/bin/sasauth root 73684 0.0 0.0 70540 2720 ? S Sep14 0:00 \_ /opt/sas/home/SASFoundation/9.4/utilities/bin/sasauth sassrv 73685 137 57.7 516571112 456745408 ? Ssl Sep14 2037:28 \_ /opt/sas/home/SASFoundation/9.4/sasexe/sas -memsize 0 -cpucount ACTUAL -noterminal -noxcmd -netencryptalgorithm SASProprietary -metaserve root 73824 0.0 0.0 21504 1168 ? S Sep14 0:00 | \_ saselssrv 13 10 14 2 823cf -classfactory 440196D4-90F0-11D0-9F41-00A024BB830C sassrv 73692 0.0 0.1 3239652 1488804 ? Ssl Sep14 0:29 \_ /opt/sas/home/SASFoundation/9.4/sasexe/sas -memsize 0 -cpucount ACTUAL -noterminal -noxcmd -netencryptalgorithm SASProprietary -metaserver root 73823 0.0 0.0 21504 1168 ? S Sep14 0:00 \_ saselssrv 13 10 14 2 f483e -classfactory 440196D4-90F0-11D0-9F41-00A024BB830C

 

So there must be some other variable.

PriitL
Obsidian | Level 7
That's a good idea.
I haven't found an answer to how the variable for Pooled Workspace server temporary files location is called. Some results from Google mention that it might be TMPDIR or WORK.
I'll keep searching but a hint would be much appreciated.

Thanks!
Kurt_Bremser
Super User

The pooled workspace server has its own subdirectory in the configuration tree, called PooledWorkspaceServer IIRC. Look into the configuration files there.

jklaverstijn
Rhodochrosite | Level 12

It may not always be in the environment variables. Many system values are stored in macro var as well.

 

So this in your code and read the log:

%put _all_;

You will see all the macro variables and their values defined for your session.

 

Hope this helps,

- Jan.

PriitL
Obsidian | Level 7

Thank You for Your reply, I am very grateful for the different opinions.

 

Still, this also isn't the case or at least it doesn't show any path to /tmp:

1          ;*';*";*/;quit;run;
2          OPTIONS PAGENO=MIN;
3          %LET _CLIENTTASKLABEL='Program 2';
4          %LET _CLIENTPROCESSFLOWNAME='Standalone Not In Project';
5          %LET _CLIENTPROJECTPATH='';
6          %LET _CLIENTPROJECTPATHHOST='';
7          %LET _CLIENTPROJECTNAME='';
8          %LET _SASPROGRAMFILE='';
9          %LET _SASPROGRAMFILEHOST='';
10         
11         ODS _ALL_ CLOSE;
12         OPTIONS DEV=SVG;
13         GOPTIONS XPIXELS=0 YPIXELS=0;
14         %macro HTML5AccessibleGraphSupported;
15             %if %_SAS_VERCOMP_FV(9,4,4, 0,0,0) >= 0 %then ACCESSIBLE_GRAPH;
16         %mend;
17         FILENAME EGHTML TEMP;
18         ODS HTML5(ID=EGHTML) FILE=EGHTML
19             OPTIONS(BITMAP_MODE='INLINE')
20             %HTML5AccessibleGraphSupported
21             ENCODING='utf-8'
22             STYLE=HTMLBlue
23             NOGTITLE
24             NOGFOOTNOTE
25             GPATH=&sasworklocation
26         ;
NOTE: Writing HTML5(EGHTML) Body file: EGHTML
27         
28         %put _all_;
GLOBAL SASWORKLOCATION "/opt/sas/work/tmp/SAS_workA2500000460B_someserverhostname.domain.dn/SAS_work69F80000460B_someserverhostname.domain.dn/"
GLOBAL SYSSTREAMINGLOG true
GLOBAL _CLIENTAPP 'SAS Enterprise Guide'
GLOBAL _CLIENTAPPABBREV EG
GLOBAL _CLIENTMACHINE 'CLIENT-PC-NAME'
GLOBAL _CLIENTPROCESSFLOWNAME 'Standalone Not In Project'
GLOBAL _CLIENTPROJECTNAME ''
GLOBAL _CLIENTPROJECTPATH ''
GLOBAL _CLIENTPROJECTPATHHOST ''
GLOBAL _CLIENTTASKLABEL 'Program 2'
GLOBAL _CLIENTUSERID '<user.name>'
GLOBAL _CLIENTUSERNAME 'User Name'
GLOBAL _CLIENTVERSION '8.3.6.200'
GLOBAL _EG_WORKSPACEINIT 1
GLOBAL _SASHOSTNAME 'someserverhostname.domain.dn'
GLOBAL _SASPROGRAMFILE ''
GLOBAL _SASPROGRAMFILEHOST ''
GLOBAL _SASSERVERNAME 'SASApp'
GLOBAL _METAUSER <username>
AUTOMATIC AFDSID 0
AUTOMATIC AFDSNAME 
AUTOMATIC AFLIB 
AUTOMATIC AFSTR1 
AUTOMATIC AFSTR2 
AUTOMATIC FSPBDV 
AUTOMATIC SYSADDRBITS 64
AUTOMATIC SYSBUFFR 
AUTOMATIC SYSCC 0
AUTOMATIC SYSCHARWIDTH 1
2                                                          The SAS System                    Tuesday, September 13, 2022 10:41:00 AM

AUTOMATIC SYSCMD 
AUTOMATIC SYSDATASTEPPHASE 
AUTOMATIC SYSDATE 13SEP22
AUTOMATIC SYSDATE9 13SEP2022
AUTOMATIC SYSDAY Tuesday
AUTOMATIC SYSDEVIC SVG
AUTOMATIC SYSDMG 0
AUTOMATIC SYSDSN WORK    GETENV                                                             
AUTOMATIC SYSENCODING utf-8
AUTOMATIC SYSENDIAN LITTLE
AUTOMATIC SYSENV BACK
AUTOMATIC SYSERR 0
AUTOMATIC SYSERRORTEXT 
AUTOMATIC SYSFILRC 1
AUTOMATIC SYSHOSTINFOLONG Linux LIN X64 3.10.0-1160.53.1.el7.x86_64 #1 SMP Fri Jan 14 13:59:45 UTC 2022 x86_64 CentOS Linux release 
7.9.2009 (Core) 
AUTOMATIC SYSHOSTNAME someserverhostname
AUTOMATIC SYSINCLUDEFILEDEVICE 
AUTOMATIC SYSINCLUDEFILEDIR 
AUTOMATIC SYSINCLUDEFILEFILEREF 
AUTOMATIC SYSINCLUDEFILENAME 
AUTOMATIC SYSINDEX 10
AUTOMATIC SYSINFO 0
AUTOMATIC SYSJOBID 17931
AUTOMATIC SYSLAST WORK.GETENV
AUTOMATIC SYSLCKRC 0
AUTOMATIC SYSLIBRC 0
AUTOMATIC SYSLOGAPPLNAME 
AUTOMATIC SYSMACRONAME 
AUTOMATIC SYSMAXLONG 9007199254740992
AUTOMATIC SYSMENV S
AUTOMATIC SYSMSG 
AUTOMATIC SYSNCPU 4                   
AUTOMATIC SYSNOBS 1
AUTOMATIC SYSODSESCAPECHAR 03
AUTOMATIC SYSODSGRAPHICS 0
AUTOMATIC SYSODSPATH  WORK.TEMPLAT(UPDATE) SASUSER.TEMPLAT(READ) SASHELP.TMPLMST(READ)
AUTOMATIC SYSPARM 
AUTOMATIC SYSPRINTTOLOG 
AUTOMATIC SYSPRINTTOLIST 
AUTOMATIC SYSPROCESSID 41DD7C15775387054018000000000000
AUTOMATIC SYSPROCESSMODE SAS Workspace Server
AUTOMATIC SYSPROCESSNAME Object Server
AUTOMATIC SYSPROCNAME 
AUTOMATIC SYSRC 0
AUTOMATIC SYSSCP LIN X64
AUTOMATIC SYSSCPL Linux
AUTOMATIC SYSSITE 70233001
AUTOMATIC SYSSIZEOFLONG 8
AUTOMATIC SYSSIZEOFPTR 8
AUTOMATIC SYSSIZEOFUNICODE 4
AUTOMATIC SYSSTARTID 
AUTOMATIC SYSSTARTNAME 
AUTOMATIC SYSTCPIPHOSTNAME someserverhostname.domain.dn
AUTOMATIC SYSTIME 10:41
AUTOMATIC SYSTIMEZONE GMT+03:00
AUTOMATIC SYSTIMEZONEIDENT ETC/GMT-3
AUTOMATIC SYSTIMEZONEOFFSET 10800
3                                                          The SAS System                    Tuesday, September 13, 2022 10:41:00 AM

AUTOMATIC SYSUSERID <username>
AUTOMATIC SYSVER 9.4     
AUTOMATIC SYSVLONG 9.04.01M7P080620
AUTOMATIC SYSVLONG4 9.04.01M7P08062020
AUTOMATIC SYSWARNINGTEXT 
29         
30         %LET _CLIENTTASKLABEL=;
31         %LET _CLIENTPROCESSFLOWNAME=;
32         %LET _CLIENTPROJECTPATH=;
33         %LET _CLIENTPROJECTPATHHOST=;
34         %LET _CLIENTPROJECTNAME=;
35         %LET _SASPROGRAMFILE=;
36         %LET _SASPROGRAMFILEHOST=;
37         
38         ;*';*";*/;quit;run;
39         ODS _ALL_ CLOSE;
40         
41         
42         QUIT; RUN;
43         

If the issue would bit me again I'll ask user to add the line

%put _all_;

to the program and we'll see then.

At the moment I have to drop the case, I'm afraid.

 

Many thanks!

 

PriitL
Obsidian | Level 7

The problem is still glowing underneath and today the same behaviour occured (temporary files at /tmp which is not on a separate partition so the / was filled for a minute or so). I asked the user about the procedure she said she was doing some manipulations with tables (which failed, of course). So to get a solution to the current topic, just as an update.

I have turned on the Trace logging for Audit.Data.Dataset and there are lines talking about the problematic /tmp:

2022-10-05 11:09:13 WorkSpaceSRV_VA (199341): Audit.Data.Dataset.Open: TRACE [00000005] 2:sassrv - Libref=WORK Engine=V9 Member=ACCOUNT_NAME MemberType=DATA Openmode=INPUT Path=/tmp/SAS_work3FF400030AAD_sasva2/SAS_work
877E00030AAD_sasva2
2022-10-05 11:09:13 WorkSpaceSRV_VA (199341): Audit.Data.Dataset.Open: TRACE [00000005] 2:sassrv - Libref=WORK Engine=V9 Member=GRANT_NAME MemberType=DATA Openmode=INPUT Path=/tmp/SAS_work3FF400030AAD_sasva2/SAS_work
877E00030AAD_sasva2
2022-10-05 11:09:13 WorkSpaceSRV_VA (199341): Audit.Data.Dataset.Open: TRACE [00000005] 2:sassrv - Libref=WORK Engine=V9 Member=CLIENT_NAME MemberType=DATA Openmode=INPUT Path=/tmp/SAS_work3FF400030AAD_sasva2/SAS_wor
k877E00030AAD_sasva2
2022-10-05 11:09:13 WorkSpaceSRV_VA (199341): Audit.Data.Dataset.Open: TRACE [00000005] 2:sassrv - Libref=WORK Engine=V9 Member=LIIK_NAME MemberType=DATA Openmode=INPUT Path=/tmp/SAS_work3FF400030AAD_sasva2/SAS_work8
77E00030AAD_sasva2

SASApp_VA_WORK-library.PNG

There is a Libref=WORK which has the /tmp as a destination.

Now the question is how to change it. I already have these lines written to SASApp_VA/sasv9_usermods.cfg

-set STPWORK /opt/sas/data/tmp
-set TMPDIR /opt/sas/data/tmp
-set WORK /opt/sas/data/tmp

and ObjectSpawner2 restarted.

 

Is there any other variable I should add? I can't find the Work Library from Management Console (probably it is so called "system library").

Is it a bad idea to keep these STPWORK, TMPDIR and WORK at the same folder?

 

Thanks!

 

 

 

gwootton
SAS Super FREQ
If you have the end user run this it will say where it's getting the WORK location from:

proc options option=work value; run;

1 proc options option=work value; run;

SAS (r) Proprietary Software Release 9.4 TS1M7

Option Value Information For SAS Option WORK
Value: C:\Users\grwoot\AppData\Local\Temp\SAS Temporary Files\_TD19284_d10f913_
Scope: SAS Session
How option value set: Config File
Config file name:
C:\Program Files\SASHome\SASFoundation\9.4\nls\en\sasv9.cfg
--
Greg Wootton | Principal Systems Technical Support Engineer
PriitL
Obsidian | Level 7

It's a shame that the topic of this thread is a little different from its content, but oh well, what to do when trying to solve the root cause from the other end. 🙂

 

Anyway, the issue where Libref=WORK generates temporary files to /tmp is resolved now. The correct place to set -WORK variable was

<sas-home>/SASFoundation/9.4/sasv9_local.cfg

 

<sas-home>/SASFoundation/9.4/sasv9.cfg has global variables for the system and for override there's a sasv9_local.cfg.

Adding the variable 

-WORK /opt/sas/<some-directory>

resolves the issue and temporary files are now where they should be. Setting the variable from SASApp_VA/sasv9_usermods.cfg doesn't work.

Which seems strange because if I hotfix/update/upgrade the system the file might be overritten with defaults and I event won't go there to modify the environment.

 

Oh, and it even doesn't need ObjectSpawner restart to apply.

 

Thanks to everyone who thought along.

 

 

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 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 14 replies
  • 2410 views
  • 4 likes
  • 5 in conversation