12-14-2017 10:26 AM - edited 12-14-2017 10:28 AM
I do have a perfectly fine working shell command:
ssh email@example.com > /home/some/path/test42.txt mysql -u johnny -psomeawkwardpassword > /home/some/path/test42.txt <<< "select * from information_schema.TABLES WHERE table_schema = 'some_value' "
When running in a shell, I get the executed query results written to the text file "test42.txt"
However, when I try to execute this shell command from within SAS-EG I get a &sysrc=2 !
(Unfortunately, the SAS log does not include error messages from the operating system (or any output done to stdout and stderr) during execution of the shell command)
In the SAS-Log, however, I do not get any kind of error or warning whatsoever!
I am using %sysexec:
mysql -u johnny -psomeawkwardpassword > /home/some/path/test42.txt
<<< "select * from information_schema.TABLES WHERE table_schema = 'some_value' "))
What is the correct SAS-EG syntax?
12-14-2017 10:55 AM
I don't think this is a syntax error.
Check the value of the SAS option XCMD. If it is set to NOXCMD then you are prevented from issuing shell commands. You may be able to reset it to XCMD but your sys admin may have prevented this.
12-14-2017 11:20 AM
A small step to try ... this particular command does not require %nrbquote. Try getting rid of %unquote and %nrbquote and the two sets of parentheses and see if that improves the information you receive about where the problem lies.