![]() Chapter Contents |
![]() Previous |
![]() Next |
| CONTROL |
| Category: | Control Flow |
| Comparisons: | SAS Statement with limitations in SCL |
| Syntax | |
| Details | |
| Examples | |
| Example 1: Using the ASIS Option | |
| Example 2: Controlling a Program Interrupt | |
| See Also | |
Syntax |
| CONTROL options; |
ALLCMDS provides the same functionality as the ALWAYS option and enables a program to intercept custom commands. In addition, ALLCMDS allows an SCL program to intercept procedure-specific commands. In FRAME entries only, ALLCMDS allows an SCL program to intercept full-screen global commands. For a listing of full-screen global commands, see EXECCMDI .
H to halt and R to resume.
Use NOBREAK to restore the default behavior. NOBREAK clears the current CONTROL BREAK specification.
Note:
If CONTROL LABEL is specified, a window variable section
must not contain a SUBMIT IMMEDIATE block. ![[cautend]](../common/images/cautend.gif)
| Details |
| Examples |
control asis;
submit;
data a;
input x y z;
datalines;
10 20 30
40 50 60
run;
endsubmit;
rc=preview('display');
With the CONTROL ASIS statement in effect, the
submit block executes without errors. If you remove the CONTROL ASIS statement,
SCL formats the code within the block as follows when the code is submitted
for processing:
data a; input x y z; datalines; 0 20 30 40 50 60 run;When formatted in this manner, the final statement contains a syntax error and the code cannot execute properly.
INIT:
/* define break label STOPINIT */
control break stopinit;
/* loop 500 times to allow interrupt */
/* checking with control break */
/* if user interrupts, statements in */
/* label STOPINIT execute */
do i=1 to 500;
put i=;
end;
/* reset so there is no break handler */
control nobreak;
/* loop 500 times to allow interrupt */
/* checking without control break */
do i = 1 to 500;
if (int(i/25) eq (i/25)) then put i=;
end;
return;
MAIN: return;
TERM:
/* Define the new break label STOPTERM. */
control break stopterm;
/* Loop 500 times to allow */
/* interrupt checking with control */
/* break. If user interrupts, */
/* statements in label STOPTERM */
/* execute. */
do j=1 to 500;
put j=;
end;
/* Reset so there is no break handler. */
control nobreak;
/* Loop 500 times to allow */
/* interrupt checking without control */
/* break. */
do j = 1 to 500;
if (int(j/25) eq (j/25)) then put j=;
end;
return;
STOPINIT:
/* HALT if loop counter is less than 350, */
/* otherwise RESUME. */
/* Report the current status. */
put i=;
if (i < 350) then
_status_ = 'H';
else
_status_ = 'R';
return;
STOPTERM:
/* HALT if loop counter is less than 350, */
/* otherwise RESUME. */
/* Report the current status. */
put j=;
if (j < 350) then
_status_ = 'H';
else
_status_ = 'R';
return;
| See Also |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.