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

 

 

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!
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).

SAS For Dummies 3rd Edition! Check out the new edition, covering SAS 9.4, SAS Viya, and all of the modern ways to use SAS!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 2213 views
  • 9 likes
  • 5 in conversation