IBM Support

PM46908: Python scripting: PIVOT TABLE LABEL INDEXING WRONG WITH FAST TABLES BUT WORKS WITH LEGACY TABLES.

Subscribe

You can track all active APARs for this component.

 

APAR status

  • Closed as program error.

Error description

  • You work with IBM SPSS Statistics 20 and created a frequency
    table as fast table as in the example below for jobcat in
    Employee.data.sav: However, when you select the freq table in
    the viewer manually and run the script below you see wrong label
    indexing in the resulting output.
    
    Example:
    
    GET FILE = 'Employee data.sav'.
    SET TABLERENDER = LIGHT.
    FREQ jobcat.
    
    * select the freq table manually and run the program below with
    fast tables.
    
    BEGIN PROGRAM.
    import SpssClient
    
    SpssClient.StartClient()
    objOutputDoc = SpssClient.GetDesignatedOutputDoc()
    objOutputItem = objOutputDoc.GetCurrentItem()
    objPivotTable = objOutputItem.GetSpecificType()
    
    objRowLabels=objPivotTable.RowLabelArray()
    for i in range(objRowLabels.GetNumRows()):
       for j in range(objRowLabels.GetNumColumns()):
          try:
             popis = objRowLabels.GetValueAt(i,j)
             print '(',i,',',j,")", popis
          except:
             pass
    END PROGRAM.
    
    As a result in the viewer you get this output, which is wrong:
    
    ( 0 , 0 )
    ( 0 , 1 ) Valid
    ( 0 , 2 )
    ( 0 , 3 )
    ( 0 , 4 ) Clerical
    ( 1 , 0 )
    ( 1 , 1 ) Valid
    ( 1 , 2 )
    ( 1 , 3 )
    ( 1 , 4 ) Custodial
    ( 2 , 0 )
    ( 2 , 1 ) Valid
    ( 2 , 2 )
    ( 2 , 3 )
    ( 2 , 4 ) Manager
    ( 3 , 0 )
    ( 3 , 1 ) Valid
    ( 3 , 2 ) Total
    
    
    This was reported to IBM SPSS Development.
    As a workaround please create the table as full rendered table
    instead of fast table and run your script again:
    GET FILE = 'Employee data.sav'.
    SET TABLERENDER = FULL.
    FREQ jobcat.
    
    The result for legacy, full rendered tables will be correct
    then:
    
    ( 0 , 0 ) Employment Category
    ( 0 , 1 ) Valid
    ( 0 , 2 ) Clerical
    ( 1 , 0 ) Employment Category
    ( 1 , 1 ) Valid
    ( 1 , 2 ) Custodial
    ( 2 , 0 ) Employment Category
    ( 2 , 1 ) Valid
    ( 2 , 2 ) Manager
    ( 3 , 0 ) Employment Category
    ( 3 , 1 ) Valid
    ( 3 , 2 ) Total
    

Local fix

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * Users working with fast tables and Python pivot table label  *
    * indexing                                                     *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * You work with IBM SPSS Statistics 20 and created a frequency *
    * table as fast table as in the example below for jobcat in    *
    * Employee.data.sav: However, when you select the freq table   *
    * in                                                           *
    * the viewer manually and run the script below you see wrong   *
    * label                                                        *
    * indexing in the resulting output.                            *
    *                                                              *
    * Example:                                                     *
    *                                                              *
    * GET FILE = 'Employee data.sav'.                              *
    * SET TABLERENDER = LIGHT.                                     *
    * FREQ jobcat.                                                 *
    *                                                              *
    * * select the freq table manually and run the program below   *
    * with                                                         *
    * fast tables.                                                 *
    *                                                              *
    * BEGIN PROGRAM.                                               *
    * import SpssClient                                            *
    *                                                              *
    * SpssClient.StartClient()                                     *
    * objOutputDoc = SpssClient.GetDesignatedOutputDoc()           *
    * objOutputItem = objOutputDoc.GetCurrentItem()                *
    * objPivotTable = objOutputItem.GetSpecificType()              *
    *                                                              *
    * objRowLabels=objPivotTable.RowLabelArray()                   *
    * for i in range(objRowLabels.GetNumRows()):                   *
    *   for j in range(objRowLabels.GetNumColumns()):              *
    *       try:                                                   *
    *         popis = objRowLabels.GetValueAt(i,j)                 *
    *         print '(',i,',',j,")", popis                         *
    *       except:                                                *
    *         pass                                                 *
    * END PROGRAM.                                                 *
    *                                                              *
    * As a result in the viewer you get this output, which is      *
    * wrong:                                                       *
    *                                                              *
    * ( 0 , 0 )                                                    *
    * ( 0 , 1 ) Valid                                              *
    * ( 0 , 2 )                                                    *
    * ( 0 , 3 )                                                    *
    * ( 0 , 4 ) Clerical                                           *
    * ( 1 , 0 )                                                    *
    * ( 1 , 1 ) Valid                                              *
    * ( 1 , 2 )                                                    *
    * ( 1 , 3 )                                                    *
    * ( 1 , 4 ) Custodial                                          *
    * ( 2 , 0 )                                                    *
    * ( 2 , 1 ) Valid                                              *
    * ( 2 , 2 )                                                    *
    * ( 2 , 3 )                                                    *
    * ( 2 , 4 ) Manager                                            *
    * ( 3 , 0 )                                                    *
    * ( 3 , 1 ) Valid                                              *
    * ( 3 , 2 ) Total                                              *
    *                                                              *
    *                                                              *
    * This was reported to IBM SPSS Development.                   *
    * As a workaround please create the table as full rendered     *
    * table                                                        *
    * instead of fast table and run your script again:             *
    * GET FILE = 'Employee data.sav'.                              *
    * SET TABLERENDER = FULL.                                      *
    * FREQ jobcat.                                                 *
    *                                                              *
    * The result for legacy, full rendered tables will be correct  *
    * then:                                                        *
    *                                                              *
    * ( 0 , 0 ) Employment Category                                *
    * ( 0 , 1 ) Valid                                              *
    * ( 0 , 2 ) Clerical                                           *
    * ( 1 , 0 ) Employment Category                                *
    * ( 1 , 1 ) Valid                                              *
    * ( 1 , 2 ) Custodial                                          *
    * ( 2 , 0 ) Employment Category                                *
    * ( 2 , 1 ) Valid                                              *
    * ( 2 , 2 ) Manager                                            *
    * ( 3 , 0 ) Employment Category                                *
    * ( 3 , 1 ) Valid                                              *
    * ( 3 , 2 ) Total                                              *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * Install IBM SPSS Statistics 20 FixPack 1 (20.0.0.1)          *
    ****************************************************************
    

Problem conclusion

  • Install IBM SPSS Statistics 20 FixPack 1 (20.0.0.1)
    

Temporary fix

Comments

APAR Information

  • APAR number

    PM46908

  • Reported component name

    SPSS STATISTICS

  • Reported component ID

    5725A54ST

  • Reported release

    K00

  • Status

    CLOSED PER

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2011-09-01

  • Closed date

    2012-03-01

  • Last modified date

    2012-03-01

  • APAR is sysrouted FROM one or more of the following:

  • APAR is sysrouted TO one or more of the following:

Fix information

  • Fixed component name

    SPSS STATISTICS

  • Fixed component ID

    5725A54ST

Applicable component levels

  • RK00 PSN

       UP

  • RK00 PSY

       UP

[{"Business Unit":{"code":"BU048","label":"IBM Software"},"Product":{"code":"SSCQ88K","label":"Statistics Desktop"},"Component":"","ARM Category":[],"Platform":[{"code":"PF025","label":"Platform Independent"}],"Version":"20.0","Edition":"","Line of Business":{"code":"","label":""}}]

Document Information

Modified date:
01 March 2012