3

I want an alternative to running frequency for string variables because I also want to get a case number for each of the string value (I have a separate variable for case ID).

After reviewing the string values I will need to find them to recode which is the reason I need to know the case number.

I know that PRINT command should do what I want but I get an error - is there any alternative?

PRINT /  id var2 .
EXECUTE.


>Error # 4743.  Command name: PRINT
>The line width specified exceeds the output page width or the record length or
>the maximum record length of 2147483647.  Reduce the number of variables or
>split the output line into several records.
>Execution of this command stops.
Tony
  • 69
  • 8

1 Answers1

2

Try the LIST command.

I often use the TEMPORARY commond prior to the LIST command, as often there is only a small select of record of interest I may want to "list"/investigate.

For example, in the below, only to list the records where VAR2 is not a blank string.

TEMP.
SELECT IF (len(VAR2)>0).
LIST ID VAR2.

Alternatively, you could also (but dependent on having CUSTOM TABLES add-on module), do something like below which would get the results into a tabular format also (which may be preferable if then exporting to Excel, for example.

CTABLES /TABLE CTABLES /VLABELS VARIABLES=ALL DISPLAY=NONE
  /TABLE A[C]>B[C]
  /CATEGORIES VARIABLES=ALL EMPTY=EXCLUDE.
Jignesh Sutar
  • 2,909
  • 10
  • 13
  • Thanks, I remember I tried working with LIST command but the problem is that it displays all values and most of them are missing! Very hard to work with. And because this is a string I couldn't find a way to filter missing values out. – Tony Dec 08 '15 at 11:02
  • The `TEMP/SELECT IF` should solve that, shouldn't it not? If applying the appropriate filter criteria? – Jignesh Sutar Dec 08 '15 at 11:04
  • I think so but it didn't! But I've now changed >0 to >1 and it works wonders. Many thanks!I don't suppose it is possible to have the result in one line like PRINT would do? LIST lists variables one below the other – Tony Dec 08 '15 at 11:11
  • `CTABLES` should give you a little more control on your desired output required? – Jignesh Sutar Dec 08 '15 at 11:17
  • CTABLES cost too much but nevermind, thanks for your help – Tony Dec 08 '15 at 11:19
  • Far from a sales rep for SPSS myself, but it is well worth it. – Jignesh Sutar Dec 08 '15 at 11:20
  • 1
    The `CTABLES` command here I think will be pretty similar to what `SUMMARIZE` would spit out. – Andy W Dec 08 '15 at 14:33
  • SUMMARIZE is probably your best bet. CTABLES is intended for aggregates, not case listings – JKP Dec 08 '15 at 23:14