Date: Mon, 25 Aug 2003 21:05:52 +0100
Reply-To: JC Dashper <johndashper@SELECTIVE.CO.UK>
Sender: "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From: JC Dashper <johndashper@SELECTIVE.CO.UK>
Subject: !CONCAT
Content-Type: text/plain; charset="iso-8859-1"
Help please,
I am trying to use !concat to join a defined variable, !cat (=cd13),
(which will assume various values at other times),
with the string 'seg'.
The required result is cd13seg.
When I use !CONCAT(!cat,'seg') the result is !CATseg.
What is confusing is that if I try !CONCAT('seg',!cat) the result is
segCD13.
And if I put a space in front of seg i.e. !CONCAT(!cat,' seg') the result
is CD13 seg.
My (abbreviated) syntax is:
define !cat ()
cd13
!enddefine.
define !hslists ()
A1
A2
!enddefine.
new file.
GET FILE='C:\temp\test.sav'.
*/////////////////////////////////////////*.
define!anal6 (!POSITIONAL !CMDEND ).
!DO !i !IN (!1)
do if !CONCAT(!cat,'seg')=!quote(!concat(' ',!i)) .
compute !i=1.
end if.
!DOEND.
!ENDDEFINE.
*/////////////////////////////////////////*.
set mprint=yes.
!anal6 !hslists.
exec.
I can work-round the difficulty but I am intrigued to know
what I'm doing wrong.
Regards
John Dashper
************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the sender or system manager.
*************************************************************
Selective Marketplace Limited
Registered Office: Belton Road West, Loughborough, Leics. LE11 5XL
Registered in England No. 1566688
*************************************************************