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
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.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.
Ready to level-up your skills? Choose your own adventure.