I'm taking a guess here, but I suspect that there are some oracle-enabling environment variables that are not being set when you run your SAS command.
When you run within EG, EG connects to a SAS session that is launched by the object spawner. The object spawner launches a SAS command that is, most likely, wrapped up in a shell script that sets some environment variables so that your SAS session can act as an Oracle client.
You'll probably want to contact tech support for help in figuring this one out.
Chris