I have a text file generated by an old, no-longer-used data entry program (KE3). Each case has multiple records, and the number of records varies from case to case. Each record contains a response to a question; some of the responses exceed 80 characters (limitation of KE3) and so are continued on another line. I'd like to import these data into SPSS, combining related records. For each line, columns 1 - 3 contain the "card number" -- which corresponds to a specific item in the survey. (The reference to "cards" indicates the age of the program these data were entered in...) Columns 4-6 contain the family ID number; column 7 is a "person ID number", columns 8 - 91 contain the response for the item. So, cards 400 through 477 are a single case. You will see that the cases each have a different number of records -- when an answer exceeds the 91-column limit, it is continued on the next line(s), with the *same* card number. For example, in the first case, card 447 is entered twice to accommodate a longer answer. In the second case, card 406 is entered four times to accommodate an even longer answer. *(A) Posted to SPSSX-L by Ray on 2002/08/17. * Syntax assumes that the maximum length of a response is 255 characters. DATA LIST FIXED /cardnb 1-3(F) familyid 4-6 (F) personid 7-7 (F) response 8-91(A). BEGIN DATA 40005431SHORT ANSWER 4010543SHORT ANSWER 40205438 40305438 40405438 40505438 40605438 40705438 40805438 40905438 41005438 41105438 41205438 41305438 41405438 4150543SHORT ANSWER 4160543SLIGHTLY LONGER ANSWER 41705438 41805438 41905438 42005438 42105438 42205438 42305438 42405438 42505438 42605438 42705439 42805438SHORT ANSWER 42905438 43005438 43105438 43205438 43305438 43405438 43505438 43605438 43705438 4380543 SHORT ANSWER 4390543 SHORT ANSWER 44005438 44105438 44205438 44305438 44405438 44505438 44605438 4470543LONG ANSWER THAT IS CONTINUED ACROSS TWO LINES 4470543REST OF LONG ANSWER THAT IS CONTINUED ACROSS TWO LINES 4480543 SHORT ANSWER 4490543 SHORT ANSWER 45005438 45105438 45205438 45305438 45405438 45505438 45605438 45705438 45805438 45905438 46005438 46105438 4620543 SHORT ANSWER 46305438 46405438 46505438 46605438 4670543 SHORT ANSWER 46805438 4690543 SHORT ANSWER 47005438 47105438 47205438 47305438 47405438 47505438 47605438 47705438 4003013 SHORT ANSWER 4013013 40230138 40330138 40430138 40530138 4063013LONG ANSWER THAT GOES ON AND ON 4063013LONG ANSWER THAT GOES ON AND ON 4063013LONG ANSWER THAT GOES ON AND ON 4063013LONG ANSWER THAT GOES ON AND ON 40730138 40830138 40930138 41030138 41130138 41230138 41330138 41430138 41530134063013LONG ANSWER THAT GOES ON AND ON 41530134063013LONG ANSWER THAT GOES ON AND ON 41530134063013LONG ANSWER THAT GOES ON AND ON 4163013SHORT ANSWER 41730138 41830138 41930138 42030138 42130138 42230138 42330138 42430138 42530138 42630138 4273013SHORT ANSWER 4283013 SHORT ANSWER 42930138 43030138 43130138 4323013 SHORT ANSWER 43330138 43430138 43530138 43630138 43730138 4383013 SHORT ANSWER 4393013 SHORT ANSWER 44030138 44130138 44230138 44330138 44430138 44530138 44630138 4473013 SHORT ANSWER 44830138 44930138 4503013 SHORT ANSWER 4513013 SHORT ANSWER 4523013 4533013 45430138 45530138 45630138 45730138 4583013 4593013 4603013 4613013 4623013 4633013 4643013 4653013 4663013 4673013 46830138 4693013 4703013 SHORT ANSWER 4713013 4723013 47330138 47430138 47530138 47630138 4773013 40039331 4013933 40239338 40339338 40439338 40539338 40639338 40739338 40839338 40939338 41039338 41139338 41239338 41339338 41439338 4153933 SHORT ANSWER 4163933 41739338 41839338 41939338 42039338 42139338 42239338 42339338 42439338 42539338 42639338 42739339 42839338 42939338 4303933 SHORT ANSWER 43139338 43239338 43339338 43439338 43539338 43639338 43739338 43839338 43939338 44039338 44139338 44239338 44339338 44439338 44539338 44639338 4473933LONG ANSWER THAT GOES ON AND ON 4473933LONG ANSWER THAT GOES ON AND ON 4473933LONG ANSWER THAT GOES ON AND ON 4473933LONG ANSWER THAT GOES ON AND ON 4473933LONG ANSWER THAT GOES ON AND ON 4473933LONG ANSWER THAT GOES ON AND ON 44839338 44939338 45039338 45139338 45239338 45339338 45439338 45539338 45639338 45739338 4583933 45939338 46039338 46139338 46239338 46339338 46439338 46539338 4663933 46739338 46839338 46939338 47039338 47139338 47239338 47339338 47439338 47539338 47639338 47739338 40019431SHORT ANSWER 4011943 SHORT ANSWER 40219438 40319438 40419438 4051943 SHORT ANSWER 40619438 40719438 40819438 40919438 41019438 41119438 41219438 4131943 SHORT ANSWER 41419438 4151943 SHORT ANSWER 4161943 SHORT ANSWER 41719438 41819438 41919438 42019438 42119438 42219438 42319438 42419438 42519438 42619438 42719439 42819438 42919438 4301943 SHORT ANSWER 43119438 43219438 43319438 43419438 43519438 43619438 43719438 4381943 SHORT ANSWER 4391943 SHORT ANSWER 44019438 44119438 44219438 44319438 44419438 44519438 44619438 4471943 SHORT ANSWER 44819438 44919438 4501943 SHORT ANSWER 4511943 SHORT ANSWER 45219438 45319438 45419438 45519438 45619438 45719438 458194 SHORT ANSWER 45919438 46019438 46119438 46219438 46319438 46419438 46519438 46619438 46719438 46819438 46919438 47019438 47119438 47219438 47319438 47419438 47519438 47619438 47719438 END DATA. LIST /CASES=FROM 1 TO 25. SORT CASES BY familyid personid cardnb. COMPUTE casen=$CASENUM. RANK VARIABLES=casen BY familyid personid cardnb /RANK INTO respnb. STRING totresp(A255). COMPUTE totresp=response. IF respnb >1 totresp=CONCAT(RTRIM(LAG(totresp)),LTRIM(response)). MATCH FILES FILE* /BY=familyid personid cardnb /LAST=last /DROP=respnb. SELECT IF last=1. STRING card400 TO card477(A255). VECTOR card=card400 TO card477. COMPUTE card(cardnb-399)=totresp. AGGREGATE OUTFILE=* /PRESORTED /BREAK=familyid personid /card400 TO card477 = MAX(card400 TO card477). * Make data window easy to read. DO REPEAT var=ALL. VARIABLE WIDTH var(11). END REPEAT. EXECUTE.