Chapter Contents

Previous

Next
NEXTCMD

NEXTCMD



Discards the current command on the command line

Category: Command


Syntax
Details
Example
See Also

Syntax

CALL NEXTCMD();


Details

NEXTCMD deletes the words up to the next semicolon or up to the end of the command. If a semicolon is not found, the entire contents of the command line are deleted.

Ordinarily, you clear the command line after reading a command or a series of commands. NEXTCMD is usually used in conjunction with CONTROL ENTER, ALWAYS, or ALLCMDS.

If the command line contains two or more commands separated by semicolons, then only the first command on the command line is executed during the current execution of the MAIN section. The next command is executed when control is returned to the program or when another entry is displayed, as in the use of the DISPLAY routine.


Example

Suppose you have an FSEDIT application and you want to prevent everyone but one user from deleting rows. You can use NEXTCMD to remove all commands that start with DEL for users other than USERAA.

FSEINIT:
    control always;
return;

INIT:
return;

MAIN:
if word(1,'u') =: 'DEL' and
symget('sysjobid') ne 'USERAA' then
   do;
      call nextcmd();
      _msg_=
      'You are not authorized to delete rows';
   end;
return;

TERM:
return;
Issue the command AXX BXX; CXX DXX. After NEXTCMD is called, only CXX DXX remains in the command buffer. After NEXTCMD is called a second time, no commands remain to be processed.

See Also

NEXTWORD

WORD


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.