Executing SAS code in a frame

Reply
Occasional Contributor
Posts: 11

Executing SAS code in a frame

Hi,

I'm trying to execute some SAS code, as a response to pressing of a button in a frame. I've put the code in a 'submit continue' block, like it was said in another place on the forum. Yet, the code seems to be totally ignored... what am I doing wrong here?

Here's what i have as the event handler block. Anu code i put outside of submit block works just fine, like the label part.

RUNBUTTON:

        submit continue;

           proc print data=sashelp.class;

           run;

        endsubmit;

     

        runButton.label = 'pressed';

RETURN;

Valued Guide
Posts: 3,208

Re: Executing SAS code in a frame

You are doing nothing wrong, it is normal behavior of using scl.

http://support.sas.com/documentation/cdl/en/sclref/67564/HTML/default/viewer.htm#p0zd8kh1xqn3zun1jy5...

Note: By default, code is not submitted               immediately when the submit block is encountered in an executing program.

---->-- ja karman --<-----
Occasional Contributor
Posts: 11

Re: Executing SAS code in a frame

But from the description of Continue option, I got the impression that the submit block should be executed immediately, and the rest of the program should be suspended until the block is done. This is clearly not happening here...

CONTINUE

suspends program execution while the submit block executes and then continues program execution at the statement that immediately follows the ENDSUBMIT statement.

Valued Guide
Posts: 3,208

Re: Executing SAS code in a frame

Id did give the link how the preview-buffer is used and the note I copied is in the bottom.

The description of scl continue statement is not clear. It can be read as:

- the scl execution (your af program) is suspended while doing the submit block.

- after placing all things in the proview buffer scl(af) will proceed his processing.

SAS(R) Component Language 9.4: Reference, Third Edition (submit scl)

SUBMIT labels the beginning of a block of SAS statements or commands to submit to SAS software. When SUBMIT is encountered, SCL collects all the text between SUBMIT and ENDSUBMIT and places it in the PREVIEW buffer. Based on the value of the when option, SCL submits the statements to SAS for execution at the appropriate time.

The where and host options are valid only if the when option is specified. Regardless of the value of the where option, all submit block text can be buffered in the PREVIEW window. You need to make certain that the CONTINUE option is specified when you want the statements to be submitted.

By default, when control returns to SCL, the program continues to execute the statements that follow ENDSUBMIT.

See the example on the preview buffer, it is submitted not processed by the sas language processor and cleared whit a cancel action

SAS(R) Component Language 9.4: Reference, Third Edition

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 3 replies
  • 184 views
  • 0 likes
  • 2 in conversation