BookmarkSubscribeRSS Feed
fxtixa
Calcite | Level 5

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.

8 REPLIES 8
Kurt_Bremser
Super User

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.

Ksharp
Super User
You need 'quit;' to end this.

proc IML;
A = {1 2};
quit;
ChrisHemedinger
Community Manager

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.

 

ChrisHemedinger_0-1652873092407.png

Example log:

ChrisHemedinger_1-1652873135439.png

 

 

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!
Rick_SAS
SAS Super FREQ

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)

Rick_SAS
SAS Super FREQ

My 2015 article explicitly says "EG does not have an interactive mode."

ChrisHemedinger
Community Manager

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).

Register for SAS Innovate 2025!! The premier event for SAS users, May 6-9 in Orlando FL. Sign up now for the best deals!

sas-innovate-white.png

Special offer for SAS Communities members

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.

 

View the full agenda.

Register now!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 1529 views
  • 9 likes
  • 5 in conversation