SAS %sysget(SAS_EXECFILEPATH) doesn't exist - sas

I am running this simple macro:
%macro grabpathname ;
%sysget(SAS_EXECFILEPATH)
%mend grabpathname;
%put %grabpathname;
And I am getting the following error:
WARNING: The argument to macro function %SYSGET is not defined as a
system variable.
I am using Enterprise Guide 5.1
What am I doing wrong? I need this as I want to use relative paths for my programs.

As per [this note](http://support.sas.com/kb/36/613.html, SAS_EXECFILEPATH isn't defined anywhere but in DM sessions of SAS on Windows. In EG you don't have access to that.
I would suggest considering what you're using it for. If you're using it to identify where other programs are stored, in EG you should be able to generally avoid using that style of coding and instead incorporate all necessary programs into your EGP. If you're using it to identify data locations or output locations, I suggest writing promts or macro variables to define that, and having a single EGP to run multiple inputs/outputs rather than copying it to multiple directories.

One of the new features added to SAS Enterprise Guide 4.3 is the ability to have a relative reference to an external file. Since you're on 5.1, this should apply to you as well.
"In previous releases of SAS Enterprise Guide, the project file stored external file references as absolute paths. In SAS Enterprise Guide 4.3, these external file references are stored as relative paths, which makes it easier for you to move the project file, data, and programs to a different folder or a different machine. In SAS Enterprise Guide 4.3, use pathnames that are relative to the current location of the project file instead of using a full path."
-- SAS Enterprise Guide: New Features in 4.3
To enable the functionality for your Enterprise Guide project:
Open the project
File | Project Properties | File References
Check the box "Use paths relative to the project for programs and importable files"

Related

How to create SAS Enterprise Guide Project without using SAS EG?

I want to create a SAS Enterprise Guide project without using SAS EG. Thank you in advance for you answers.
Tried creating a zip file with SAS programs and renaming the .zip extension to .egp, but it does not work.
I'm almost certain that there's some legal issue with reverse engineering it.
That being said - .egp does seem to be an archive.
For the most part,
it contains folders of generated names for each program in the .egp, as well as a folder with a generated name for the built in git repository.
and probably most importantly a .xml file describing the project, It also contains any embedded code.
I don't have time to go through it, but if you have Enterprise Guide licensed and just don't have access to it, perhaps ask a colleague to send an example project.
If instead of creating a *.zip file, you create a *.txt file.
Changing it's extension to *.sas will create a SAS program.

In free SAS University Edition convert .sas7bdat to .csv

I am using the free SAS university edition in the browser and would like to convert a data set into a csv format. How do I do this?
I have tried this but it doesn't work since the browser version doesn't use a traditional file path.
PROC EXPORT or any of the other solutions will work fine. However, you need to be able to identify the location of the shared folder you are using between SAS Studio/University Edition and your main computer.
Assuming you followed the instructions when you set up the SAS University Edition virtual machine, you have a folder located at the virtual path
/folders/myfolders/
(Or named differently if you named it something else.) That can then be used as the path to proc export.

how to change the locale language on SAS?

the system options shows other than english on the SAS product, due to which some of the properties and also the help manual is not in english, how is it possible to change it? or do I have to install the SAS again?
As long as you installed the correct language(s), it's possible to run SAS in different languages. However, if you only installed one language, it will be sufficiently complicated that I would recommend an update installation (which is not a full reinstall).
This SAS technical support note covers this in some detail; it also recommends an update installation if you didn't install the language originally.
What you can do is look at the SASFoundation folder in your install, usually one more folder deep (the version), and then look at the nls folder. nls refers to language support, and it should have one folder for each language installed, including Unicode support and DBCS support. \nls\en will exist if you installed English.
If that's the case, you can edit your sasv9.cfg to point to the config file you want to use - ie, the \nls\en config file. It probably points to whatever you currently are running.
You also can on the fly run one or the other simply by including in the shortcut or launch program the -config option pointing to the config file you want.

How can we import files from PC directly in SAS University Edition?

I am using SAS University Edition and i have to import files into SAS software. I have tried using 'infile' and 'proc import' statements but these are not working when accessing the files directly from PC.
Is there a way to access the files directly from PC in SAS UE?
Yes.
In the folder where you have SAS University Edition VM located
created a folder called myfolders.
In the VM create a shared folder to that folder using the VM
settingsn th
Move the file to that location and use a UNIX path that is case sensitive to refer to the file in your infile statement.
There are other ways but this is the simplest to start off with.
Detailed instructions vary slightly based on your OS (MAC/PC) and VM(ORACLE/VMWARE). Please see the SAS Analytics Help Centre FAQ
http://support.sas.com/software/products/university-edition/faq/main.htm
and here:
https://communities.sas.com/docs/DOC-7211

How to create dynamic defines for Visual Studio?

I have a C++ project that builds on several platforms.
On Mac OSX and Linux, I use SConstruct, which allows me to have some "smartness" regarding the different compilation steps. Namely, I could put the program version in a file named VERSION at the root of the repository, whose content is simply:
2.0
In the build SConscript, I just have to open, read and parse that file and I can create dynamic defines based on it. For instance:
env.Append(CXXFLAGS=['-DVERSION_MAJOR=%s' % open('VERSION').read().split('.')[0]])
This is, for obvious reasons, very convenient. It also allows me to put today's date in an environment variable for instance.
Now for Windows, I have a .sln file with different .vcxproj files into which I'd like to do something similar, except I have no idea how.
To summarize, my question is: how can I have "smart" defines like that (reading, parsing a file and putting its content into several environment variables) without having to change the .sln/.vcxproj files manually on every version shift ?
I know I could use SCons on Windows too, but I'd like not to (mainly because it seems less popular on the platform, and I don't want to scare potential contributors that only know Windows-specific tools).
A common way to do this is to define your constants in an include file:
e.g.
// Version.h - Autogenerated, don't edit
#define VERSION_MAJOR 1
Next you write a script or a program (in your favourite language) to obtain version from somewhere and dynamically write Version.h. Possibly parse the old Version.h and increment or get it from some external source.
In visual studio, create a custom build step for Version.h and make it dependent on something that forces it to update on every build.
You could maintain the current solution, and for Windows, integrate it with Visual Studio solution and project files generated by SCons using the MSVSProject() builder or the MSVSSolution() builder.
You can find more info about these SCons builders here.