BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
bentleyj1
Quartz | Level 8

I have a need to write a program that runs manually on EG connected to a server and on SAS/Win submitting to a server and on Linux with the job submitted as batch with Cron.  In the past I've used &sysscp to identify if we're running on SAS/Win or a server but how to identify EG?

 

EG creates automatic macro variables not created by the other environments (like _clientVersion) and I could use %SYMEXIST to see if one of them is in the global macro table, but is there an automatic variable like &sysscp that says 'EG'?   I couldn't find one.

 

https://blogs.sas.com/content/sasdummy/2012/10/09/special-macro-vars-in-eg/

 

Thanks in advance.

 

John

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
Diamond | Level 26
Hi:
EG isn't an operating system, so &sysscp won't work. The _CLIENT macro variables seem to me to be your best bet. I believe that there are 2:
GLOBAL _CLIENTAPP 'SAS Enterprise Guide'
GLOBAL _CLIENTAPPABBREV EG

Cynthia

View solution in original post

3 REPLIES 3
ErikLund_Jensen
Rhodochrosite | Level 12

Hi Bentleyj1

 

I dont think such a varible exists, but it easy to create.

 

In a typical SAS server setup there are separate server contexts, and each has its own configurations files, so EG and BATCH would use different SAS config-files. The cfg-files are placed in  locations like: 

"/sas/prod/config/Lev1/EGApp/sasv9_usermods.cfg".

 

If you (or your SAS administrator) added a line like 

-set=SAS_CONTEXT "EG" 

to a sasv9_usermods.cfg file, it would be accsible via %sysget in all programs started in that context, so

%if %sysget(SAS_CONTEXT) = EG %then ...

 

Be aware that environment-variable names are case-sensitive in Linux.

bentleyj1
Quartz | Level 8
Thanks for your idea. One of the things I like about SAS is that there is usually more than one way to do something. Of course, sometimes that's a bad thing too. 🙂
Cynthia_sas
Diamond | Level 26
Hi:
EG isn't an operating system, so &sysscp won't work. The _CLIENT macro variables seem to me to be your best bet. I believe that there are 2:
GLOBAL _CLIENTAPP 'SAS Enterprise Guide'
GLOBAL _CLIENTAPPABBREV EG

Cynthia
How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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