DEFINE-!ENDDEFINE

DEFINE—!ENDDEFINE define una macro de programa, que luego se puede utilizar dentro de una secuencia de mandatos.

DEFINE macro name 

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

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

macro body

!ENDDEFINE

Controles del mandato SET:

PRESERVE
RESTORE

Asignación:

!LET var=expression

Proceso condicional:

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

Construcciones en bucle:

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

Directivas de macro:

!OFFEXPAND 
!ONEXPAND 

Funciones de manipulación de series:

!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) 

Historial de versiones

Release 14.0

  • Para la sintaxis procesada en modalidad interactiva, las modificaciones en el recurso de macro pueden afectar a las llamadas de macro que se producen al final de un mandato.

Ejemplo

DEFINE sesvars ()
  age sex educ religion
!ENDDEFINE.