Setcalculate may be the tool you want.
setcalculate Both=A .and. B
print[orientation='across'] Both
gives
Both 6.000 5.000
1.000
However this gives just on copy
of the item. Did you want this or did you want the item repeated?
Regards
Martin
From: GENSTAT-Request
[mailto:[log in to unmask]] On Behalf Of Dr. Guillermo Hough
Sent: Friday, 18 February 2011 8:45 a.m.
To: [log in to unmask]
Subject: factor subsets
Hi everyone!
I have two
variates of equal length and I want to form two new variates that contain only
those numbers that are common to both. I worked out the following solution
using POSITION and SUBSET, but I guess there must be something less messy.
VARIATE A,B;!(6,6,2,2,3,3,5,5,1,1),!(1,1,7,7,5,5,6,6,8,8)
CALC AinB=POSITION(A;B)
CALC BinA=POSITION(B;A)
SUBSET [COND=AinB.NE.0] A;Anew
SUBSET [COND=BinA.NE.0]B;Bnew
PRINT Anew,Bnew
Thanks for your help,
Guillermo
-------------------------------
Dr. Guillermo Hough
DESA - ISETA
H. Yrigoyen 931
(6500) - 9 de Julio - Pcia. de Buenos Aires - Argentina
TEL/FAX: ++54 2317-431309
www.desa.edu.ar
Attention: The information contained in this message and/or attachments from AgResearch Limited is intended only for the persons or entities to which it is addressed and may contain confidential and/or privileged material. Any review, retransmission, dissemination or other use of, or taking of any action in reliance upon, this information by persons or entities other than the intended recipients is prohibited by AgResearch Limited. If you have received this message in error, please notify the sender immediately.