*(Q) Someone made a file which contained Census Tract#, City Name and Zip Code. When the city is the same, it was left blank.SO IS THE CASE FOR ZIP CODE. Here I have a task to rearrange the data. *(A) posted by Raynald Levesque to SPSSX-L on 2002/02/07. * The solution is VERY GENERAL, it works (as is) for any number and any mix * of numeric and string variables. DATA LIST LIST / CT(F6.2) City (A20) Zip (F5.0). BEGIN DATA 320.11,'MODJESKA',92676 423.06 'MONARCH BEACH' 92629 423.22 423.23 626.10 'NEWPORT BEACH' 92660 626.18 627.01 627.17 630.04 630.05 630.07 630.08 630.09 630.10 631.03 627.99 ' ' 92661 628.00 630.06 ' ' 92662 628.00 ' ' 92663 629.00 630.05 630.10 634.00 635.00 636.01 636.02 636.03 626.17 ' ' 92625 626.18 627.01 627.02 626.04 'NEWPORT COAST' 92657 626.17 626.18 627.02 762.01 'OLIVE' 92865 762.02 762.98 524.12 'IRVINE' 92602 524.14 525.95 626.04 ' ' 92603 626.17 END DATA. SET ERRORS=no. DO IF $CASENUM>1. DO REPEAT v=ALL. * The next 2 lines are a nice trick: * one the 2 line results in a (non consequential) error * but the other gives the correct answer. IF LEN(RTRIM(v))=0 v=LAG(v). IF MISSING(v) v=LAG(v). END REPEAT PRINT. END IF. SET ERRORS=yes. EXECUTE.