DEFINE-!ENDDEFINE

DEFINE—!ENDDEFINE defines a program macro, which can then be used within a command sequence.

DEFINE macro name 

 ([{argument name=} [!DEFAULT (string)] [!NOEXPAND] {!TOKENS  (n)             }]
   {!POSITIONAL=  }                                 {!CHAREND ('char')        }
                                                    {!ENCLOSE ('char', 'char')}
                                                    {!CMDEND                  }

 [/{argument name=} ...])
   {!POSITIONAL=  }

macro body

!ENDDEFINE

SET command controls :

PRESERVE
RESTORE

Assignment :

!LET var=expression

Conditional processing :

!IF (expression) !THEN statements
    [!ELSE statements]
!IFEND

Looping constructs :

!DO !varname=start !TO finish [!BY step]
   statements  [!BREAK]
!DOEND
 
!DO !varname !IN (list)
   statements  [!BREAK]
!DOEND

Macro directives :

!OFFEXPAND 
!ONEXPAND 

String manipulation functions :

!LENGTH (string) 
!CONCAT (string1,string2)
!SUBSTR (string,from,[length]) 
!INDEX (string1,string2) 
!HEAD (string) 
!TAIL (string) 
!QUOTE (string) 
!UNQUOTE (string) 
!UPCASE (string) 
!BLANKS (n) 
!NULL 
!EVAL (string) 

Release History

Release 14.0

Example

DEFINE sesvars ()
  age sex educ religion
!ENDDEFINE.