Concat Error?

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Concat Error?

DKUKEC
Not having any luck today, why is this not working?  Please, any assisatnce would be much appreciated.

Damir


STRING RPUIDX (A12).
COMPUTE RPUIDX = STRING (RPUID, F12.0).
EXECUTE.

STRING V1 V2 (A20) .
COMPUTE V1=LTRIM(RTRIM(RPUIDX)).
COMPUTE V2=CONCAT('('',RTRIM(V1),''=1)').

>Error # 4314 in column 40.  Text: )
>Only one argument was supplied for a function which requires at least two.
>Execution of this command stops.
EXECUTE.
Reply | Threaded
Open this post in threaded view
|

Re: Concat Error?

Albert-Jan Roskam
Hi,

You used too many quotes. Also make sure you're consistent with single and double quotes (not relevant now, but still good to remark).
COMPUTE V2=CONCAT( '(', RTRIM(V1), '=1)').
 
Regards,
Albert-Jan

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a
fresh water system, and public health, what have the Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

From: DKUKEC <[hidden email]>
To: [hidden email]
Sent: Thursday, August 16, 2012 8:34 PM
Subject: [SPSSX-L] Concat Error?

Not having any luck today, why is this not working?  Please, any assisatnce
would be much appreciated.

Damir


STRING RPUIDX (A12).
COMPUTE RPUIDX = STRING (RPUID, F12.0).
EXECUTE.

STRING V1 V2 (A20) .
COMPUTE V1=LTRIM(RTRIM(RPUIDX)).
COMPUTE V2=CONCAT('('',RTRIM(V1),''=1)').

>Error # 4314 in column 40.  Text: )
>Only one argument was supplied for a function which requires at least two.
>Execution of this command stops.
EXECUTE.




--
View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Concat-Error-tp5714735.html
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD


Reply | Threaded
Open this post in threaded view
|

Re: Concat Error?

Rich Ulrich
In reply to this post by DKUKEC
Putting two single-quotes in a row is the proper way
to insert a single-quote into a line of argument. 

  '('',RTRIM(V1),''=1)' 
thus becomes a single text string in quotes,
  (',RTRIM(V1),'=1)

which is what your error message complains about.
Since V1 is already trimmed on both sides, perhaps
you wanted
   CONCAT(   '(', V1, '=1)'  ).

Extra spaces makes lines like that one easier to read.

--
Rich Ulrich


> Date: Thu, 16 Aug 2012 11:34:20 -0700

> From: [hidden email]
> Subject: Concat Error?
> To: [hidden email]
>
> Not having any luck today, why is this not working? Please, any assisatnce
> would be much appreciated.
>
> Damir
>
>
> STRING RPUIDX (A12).
> COMPUTE RPUIDX = STRING (RPUID, F12.0).
> EXECUTE.
>
> STRING V1 V2 (A20) .
> COMPUTE V1=LTRIM(RTRIM(RPUIDX)).
> COMPUTE V2=CONCAT('('',RTRIM(V1),''=1)').
>
> >Error # 4314 in column 40. Text: )
> >Only one argument was supplied for a function which requires at least two.
> >Execution of this command stops.
> EXECUTE.
>
>
> ...
Reply | Threaded
Open this post in threaded view
|

Re: Concat Error?

David Marso
Administrator
You will Need the RTRIM within the CONCAT!!!
==
Rich Ulrich-2 wrote
Putting two single-quotes in a row is the proper way
to insert a single-quote into a line of argument.  

  '('',RTRIM(V1),''=1)'  
thus becomes a single text string in quotes,
  (',RTRIM(V1),'=1)

which is what your error message complains about.
Since V1 is already trimmed on both sides, perhaps
you wanted
   CONCAT(   '(', V1, '=1)'  ).

Extra spaces makes lines like that one easier to read.

--
Rich Ulrich


> Date: Thu, 16 Aug 2012 11:34:20 -0700
> From: [hidden email]
> Subject: Concat Error?
> To: [hidden email]
>
> Not having any luck today, why is this not working?  Please, any assisatnce
> would be much appreciated.
>
> Damir
>
>
> STRING RPUIDX (A12).
> COMPUTE RPUIDX = STRING (RPUID, F12.0).
> EXECUTE.
>
> STRING V1 V2 (A20) .
> COMPUTE V1=LTRIM(RTRIM(RPUIDX)).
> COMPUTE V2=CONCAT('('',RTRIM(V1),''=1)').
>
> >Error # 4314 in column 40.  Text: )
> >Only one argument was supplied for a function which requires at least two.
> >Execution of this command stops.
> EXECUTE.
>
>
> ...
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"