Login  Register

Do repeat extraction conversion issue

Posted by Maguin, Eugene on Oct 17, 2012; 3:13pm
URL: http://spssx-discussion.165.s1.nabble.com/Do-repeat-extraction-conversion-issue-tp5715692.html

I'm having what seems to be an incorrect problem with the following syntax.

STRING SCALE(A16).
DO REPEAT A='FunctImpairment' 'Symptoms' 'SymptomsB' 'KidStrength'
   'FamStrength' 'FamProb'/B=15 8 9 11 11 7.
+  DO IF (SUBSTR(IV,1,B) EQ A).
+     COMPUTE SCALE=SUBSTR(IV,1,B).
+     COMPUTE ITEM=NUMBER(RTRIM(SUBSTR(IV,B+1,2),' '),F2.0).
+  END IF.
END REPEAT.
EXECUTE.
FORMAT ITEM(F2.0).

The data going into/coming out (of) this do repeat are (there are multiple records for each example IV value and the range for Item is between 1 and 30)
IV      Scale   Item
FunctImpairment1        FunctImpairment 1
Symptoms1       Symptoms        1
SymptomsB27     SymptomsB       27
KidStrength1    KidStrength     1
FamStrength1    FamStrength     1
FamProb1        FamProb 1

I get this warning
>Warning # 1102
>An invalid numeric field has been found.  The result has been set to the
>system-missing value.
>Command line: 306  Current case: 195  Current splitfile group: 1
>Field contents: 'B2'

I understand what it means and I should see a sysmis value for Item for case 195. I do not however. I see the correct value: 27.

It seems like I should not have gotten the warning and, having gotten the warning, I should be seeing Item = sysmis for the indicated cases. Am I misunderstanding something (or is there a program issue)?

Gene Maguin

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD