Hello, I'm new to SAS
I’m having this odd problem with SAS on demand,
If I run this very simple code as a whole
<
proc IML;
A = {1 2};
print A;
>
It works
But if I run the first two lines and then the third it shows an error message: Statement is not valid or it is used out of proper order.
Could you help me please.
Every individual submission you do in SAS Studio (which is the interface used for On Demand) or Enterprise Guide is encapsulated in hidden start and end code. The start code sets up stuff needed by those interfaces, and the end code contains (among other things) "magic code" to clean up a failed submission (e.g. missing semicolons, unbalanced quotes, missing RUN and QUIT statements, ...).
Therefore you must always submit a whole step.
Submitting parts of steps is only possible when using the native SAS interface (called Display Manager) in a local installation.
SAS Studio offers a special setting for interactive procedures like IML. It's called "Go interactive" - once enabled, you can submit partial steps a few lines at a time and SAS Studio won't wrap/close your statements. The toolbar for this is on the code window.
Example log:
As Chris says, "Go Interactive" is what you need to run interactive procedures such as PROC IML. For details, see "Running interactive procedures in SAS Studio"
(The screen captures are from 2015)
Since I no longer have EG at hand: does Enterprise Guide have a similar option?
My 2015 article explicitly says "EG does not have an interactive mode."
It's been a long time, things could have changed; after all, both just push code to the workspace server and fetch logs.
No, SAS Enterprise Guide doesn't have an interactive mode. Just SAS Studio (and of course Display Manager and good ol' command-line interactive SAS).
Save $250 on SAS Innovate and get a free advance copy of the new SAS For Dummies book! Use the code "SASforDummies" to register. Don't miss out, May 6-9, in Orlando, Florida.
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.