Overview (OUTPUT CREATE command)

The OUTPUT CREATE command provides options for creating custom tables, charts, and other output items from user-entered JSON or from an external *.json file.

Basic specification

The specification is the command name followed by the SPEC subcommand name. The SPEC subcommand specifies either the INLINE or STATJSONFILE keywords.

  • When the INLINE keyword is specified, you can enter JSON directly in the command syntax following a BEGIN STATJSON command.
  • When the STATJSONFILE keyword is specified, you must specify an external *.json file location and name.

Operations

The OUTPUT CREATE command utilizes the IBM® SPSS® Statistics extension methodology to generate results. The command is based on the following XML and invokes the STATJSON schema.

<?xml version="1.0" encoding="UTF-8"?>
<!-- ***************************************************************** -->
<!--                                                                   -->
<!-- Licensed Materials - Property of IBM                              -->
<!--                                                                   -->
<!-- IBM SPSS Products: Statistics Common                              -->
<!--                                                                   -->
<!-- (C) Copyright IBM Corp. 1989, 2021                                -->
<!--                                                                   -->
<!-- US Government Users Restricted Rights - Use, duplication or       -->
<!-- disclosure restricted by GSA ADP Schedule Contract with IBM       -->
<!-- Corp.                                                             -->
<!--                                                                   -->
<!-- ***************************************************************** -->
​
<Command xmlns="http://xml.spss.com/spss/extension"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://xml.spss.com/spss/extension http://xml.spss.com/spss/extension/SyntaxSchema.xsd"
    Name="OUTPUT CREATE" EndRequired="None" Language="Syntax" IsArbitrary="No">
    <Subcommand Name="SPEC" EqualsSign="None">
        <Parameter Name="SOURCE" EqualsSign="Required" ParameterType="Keyword">
            <EnumValue Name="INLINE"/>
            <EnumValue Name="STATJSONFILE"/>
        </Parameter>
     </Subcommand>
</Command>

Examples

SOURCE=INLINE example

OUTPUT CREATE
    /SPEC SOURCE=INLINE.
BEGIN STATJSON
{
    "procedure": {
        "name": "Pie Test",
        "items": [
            {
                "graph": {
                    "name": "Count by Gender",
                    "title": "Pie Chart",
                    "type": "Pie",
                    "X": {
                        "data": ["male", "female"],
                        "label": "Gender"
                    },
                    "Y": {
                        "data": [100, 200],
                        "label": "Count"
                    }
                }
            }
        ]
    }
}

SOURCE=STATJSONFILE example

OUTPUT CREATE
    /SPEC SOURCE=STATJSONFILE("/statjson/examples/pie.json").