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 Hackathon registration is open! Build your skills. Make connections. Enjoy creative freedom. Maybe change the world.
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 Hackathon registration is open! Build your skills. Make connections. Enjoy creative freedom. Maybe change the world.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

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