IBM Support

PM77628: READ N PERCENT OF A TEXT FILE DOES ONLY WORK WITH SAMPLE COMMAND INCLUDED but this is not documented

Subscribe

You can track all active APARs for this component.

APAR status

  • Closed as fixed if next.

Error description

  • You work with IBM SPSS Statistics 19, 20 and 21 and would like
    to import only a certain percentage of a text file with command
    syntax. Therefore you use a syntax as on the example below:
    
    GET DATA
      /TYPE=TXT
      /FILE="C:\Program
    Files\IBM\SPSS\Statistics\21\Samples\English\demo.txt"
      /DELCASE=LINE
      /DELIMITERS="\t"
      /ARRANGEMENT=DELIMITED
      /FIRSTCASE=2
      /IMPORTCASE=PERCENT 10
      /VARIABLES=
      age F2.0.
    CACHE.
    EXECUTE.
    
    Sinve you use /IMPORTCASE=PERCENT 10 you expect that
    approximately 10% of the rows are imported but you get all rows
    instead.
    
    This was reported to IBM SPSS Development but is working as
    designed.
    When you use the Read Text Data Wizard to import your text file
    and paste the
    syntax on the last step you will see that the SAMPLE command is
    pasted as well. If you want to import a certain percentage with
    GET DATA you need
    to run the SAMPLE command included. This will import only a
    certain percentage and not all rows of the text
    file. To use the /IMPORTCASE subcommand without the SAMPLE
    command is not the correct syntax to import a certain percentage
    of a text file, you always need to use SAMPLE command as well as
    in the example below.
    
    GET DATA
      /TYPE=TXT
      /FILE="C:\Program
    Files\IBM\SPSS\Statistics\21\Samples\English\demo.txt"
      /DELCASE=LINE
      /DELIMITERS="\t"
      /ARRANGEMENT=DELIMITED
      /FIRSTCASE=2
      /IMPORTCASE=PERCENT 10
      /VARIABLES=
      age F2.0.
    SAMPLE 0.1.
    CACHE.
    EXECUTE.
    

Local fix

  • Since this behavior is by design a documentation update will be
    implemented in the next main release of IBM SPSS Statistics
    including the need to run the SAMPLE command if you want to
    import a certain percentage of a text file
    

Problem summary

  • ****************************************************************
    * USERS AFFECTED:                                              *
    * READ N PERCENT OF A TEXT FILE DOES ONLY WORK WITH SAMPLE     *
    * COMMAND                                                      *
    * INCLUDED but this is not documented                          *
    ****************************************************************
    * PROBLEM DESCRIPTION:                                         *
    * Since this behavior is by design a documentation update was  *
    * implemented in the main release of IBM SPSS Statistics 22    *
    * including the need to run the SAMPLE command if you want to  *
    * import a certain percentage of a text file                   *
    ****************************************************************
    * RECOMMENDATION:                                              *
    * This issue has been addressed in IBM SPSS Statistics 22      *
    ****************************************************************
    

Problem conclusion

Temporary fix

Comments

APAR Information

  • APAR number

    PM77628

  • Reported component name

    SPSS STATISTICS

  • Reported component ID

    5725A54ST

  • Reported release

    L00

  • Status

    CLOSED FIN

  • PE

    NoPE

  • HIPER

    NoHIPER

  • Special Attention

    NoSpecatt

  • Submitted date

    2012-11-23

  • Closed date

    2013-08-26

  • Last modified date

    2013-08-26

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

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

Fix information

Applicable component levels

  • RM00 PSN

       UP

  • RM00 PSY

       UP



Document information

More support for: SPSS Statistics
Statistics Desktop

Software version: 21.0

Reference #: PM77628

Modified date: 26 August 2013