LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2000)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 30 Jun 2000 13:05:46 -0400
Reply-To:     Raynald Levesque <rlevesque@VIDEOTRON.CA>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Raynald Levesque <rlevesque@VIDEOTRON.CA>
Subject:      Re: listing in the loop
Content-type: text/plain; charset=windows-1250

Hi Hanna,

this is a solution to your problem:

* Define dummy data file for illustration purposes. NEW file. INPUT PROGRAM. NUMERIC v191 TO v247. LOOP #id=1 TO 20. VECTOR v=v191 TO v247. LOOP #cnt=1 TO 57. DO IF MODE(#cnt,3)=0. COMPUTE v(#cnt)=UNIFORM(1). ELSE. COMPUTE v(#cnt)=UNIFORM(1)>.5. END IF. END LOOP. END CASE. END LOOP. END FILE. END INPUT PROGRAM. EXECUTE.

* define a macro to do the job. DEFINE !listvar(). FILTER OFF. !DO !cnt=191 !TO 247 !BY 3. FILTER OFF. COMPUTE L=0. !LET !a1=!CONCAT('v',!cnt). !LET !a2=!CONCAT('v',!LENGTH(!CONCAT(!BLANKS(!cnt)," "))). !LET !a3=!CONCAT('v',!LENGTH(!CONCAT(!BLANKS(!cnt)," "))). IF ( !a1=1 & !a2=0 ) L=1. FILTER BY L. LIST !a1 !a2 !a3. !DOEND. !ENDDEFINE.

*Call macro. !listvar.

HTH

Raynald Levesque rlevesque@videotron.ca

----- Original Message ----- From: Hanna Zaremba Newsgroups: bit.listserv.spssx-l To: SPSSX-L@LISTSERV.UGA.EDU Sent: Friday, June 30, 2000 9:07 AM Subject: listing in the loop

Hi all, I would like to automate that listings proces .Could someone help me to find mistake in this loop. if (v191=1 & V192=0) L1=1 . TEMPORARY . SELE IF (L1=1). LIST V191 V192 V193.

if (v194=1 & V195=0) L2=1 . TEMPORARY . SELE IF (L2=1). LIST V194 V195 V196. ..... if (v245=1 & V246=0) L19=1 . TEMPORARY . SELE IF (L19=1). LIST V245 V246 V247.

VECTOR v=V191 TO V247. LOOP #cnt=1 TO 57 BY 3. COMPUTE a1=v(#cnt). COMPUTE a2=v(#cnt+1). COMPUTE a3=v(#cnt+2). COMPUTE L=0. iF (a1=1 & a2=0) L=1. TEMPORARY. SELE IF (L=1). LIST V1 a1 a2 a3. END LOOP. EXECUTE.

All response are highly appreciated. Thanks. Hanna Zaremba CBOS, Poland h.zaremba@cbos.pl


Back to: Top of message | Previous page | Main SPSSX-L page