spsspkg.Syntax Function (R)

spsspkg.Syntax(templ). Validates values passed to the Run function of an extension command, according to the specified template. The argument is a list of TemplateClass objects, created with the spsspkg.Template function. The list should include a TemplateClass object for each possible keyword associated with the syntax for the extension command.

Example

As an example, consider an extension command named MYCOMMAND with the following syntax chart:

MYCOMMAND VARIABLES=variable list
[/OPTIONS [MISSING={LISTWISE*}] ]
                   {FAIL     }

The associated specification for the spsspkg.Syntax function is:

oobj<-spsspkg.Syntax(templ=list(
   spsspkg.Template("VARIABLES",subc="",var="vars",ktype="existingvarlist",islist=TRUE),
   spsspkg.Template("MISSING",subc="OPTIONS",var="missing",ktype="str")
             ))

Note: The spsspkg.Syntax function is used in conjunction with the implementation code for an extension command implemented in R. It is not for use within a BEGIN PROGRAM R-END PROGRAM block. Specifically, it is for use in the Run function that implements the extension command.

Information on creating extension commands is available from the following sources:

  • The article "Writing IBM® SPSS® Statistics Extension Commands", available from the IBM SPSS Predictive Analytics community at https://www.ibm.com/community/spss-statistics .
  • The chapter on Extension Commands in Programming and Data Management for IBM SPSS Statistics , which is also available from the IBM SPSS Predictive Analytics community.
  • A tutorial on creating extension commands for R is available from "Working with R" in the Help system.