CONTINUE Statement


Stops processing the current DO-loop iteration and resumes with the next iteration

Valid: in a DATA step

Category: Control

Type: Executable

Restriction: Can be used only in a DO loop

Syntax

CONTINUE;

Without Arguments

The CONTINUE statement has no arguments. It stops processing statements within the current DO-loop iteration based on a condition. Processing resumes with the next iteration of the DO loop.

Comparisons

  • The CONTINUE statement stops the processing of the current iteration of a loop and resumes with the next iteration; the LEAVE statement causes processing of the current loop to end.

  • You can use the CONTINUE statement only in a DO loop; you can use the LEAVE statement in a DO loop or a SELECT group .

Examples

This DATA step creates a report of benefits for new full-time employees . If an employee's status is PT ( part-time ), the CONTINUE statement prevents the second INPUT statement and the OUTPUT statement from executing.

 data new_emp;        drop i;        do i=1 to 5;           input name $ idno status $;           /* return to top of loop */           /* when condition is true */        if status='PT' then continue;           input benefits .;           output;     end;     datalines;  Jones 9011 PT  Thomas 876 PT  Richards 1002 FT  Eye/Dental  Kelly 85111 PT  Smith 433 FT  HMO  ; 

See Also

Statements:

  • 'DO Statement, Iterative' on page 1144

  • 'LEAVE Statement' on page 1280




SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
SAS 9.1 Language Reference Dictionary, Volumes 1, 2 and 3
ISBN: N/A
EAN: N/A
Year: 2004
Pages: 704

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net