Posted by
Maguin, Eugene on
Oct 17, 2012; 6:05pm
URL: http://spssx-discussion.165.s1.nabble.com/Do-repeat-extraction-conversion-issue-tp5715692p5715699.html
David,
I was writing a long winded, very detailed reply and I finally realized what was wrong (and for the 30,000th time the problem was my failure to work through how what I was coding worked, which I feared was the problem). The code segment:
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.
In the file IV takes on these values and takes them on in this order:
'FunctImpairment1' to 'FunctImpairment5'
'SymptomsB27' to 'SymptomsB30'
'Symptoms1' to 'Symptoms26'
'KidStrength1' to 'KidStrength12'
'FamStrength1' to 'FamStrength6'
'FamProb1' to 'FamProb14'
For example, both 'Symptoms23' and 'SymptomsB29' will satisfy the test
+ DO IF (SUBSTR(IV,1,B) EQ A).
Where A='Symptoms' . B=8, B+1=9, and SUBSTR(IV,9,2) will equal '23' for 'Symptoms23' but 'B2' for 'SymptomsB29'
I'm satisfied. Thank you for your reply, it helped me eventually see what was wrong.
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