INDEX & RINDEX function error

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

INDEX & RINDEX function error

Luca Meyer-3
Hi,

I have recently quite happily moved to PASW for Mac but I yet have to find complete compatibility with previous (Win) version.

What I am getting quite often is this kind of warning:

>Warning # 618
>The length of each test substring for the INDEX or RINDEX function is greater
>than the length of the string to be searched.  The result has been set to the
>system-missing value.
>Command line: 11893  Current case: 1  Current splitfile group: 1

Now, my string variable is way larger than the length of the substring to be searched. Someone might point out for me what the matter can be in this case?

Thanks,
Luca 

Luca Meyer

Reply | Threaded
Open this post in threaded view
|

Re: INDEX & RINDEX function error

ViAnn Beadle

You need to provide more details such as the actual syntax used along with the defined string widths for all variables used.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Luca Meyer
Sent: Monday, April 20, 2009 8:40 AM
To: [hidden email]
Subject: INDEX & RINDEX function error

 

Hi,

 

I have recently quite happily moved to PASW for Mac but I yet have to find complete compatibility with previous (Win) version.

 

What I am getting quite often is this kind of warning:

 

>Warning # 618
>The length of each test substring for the INDEX or RINDEX function is greater
>than the length of the string to be searched.  The result has been set to the
>system-missing value.

>Command line: 11893  Current case: 1  Current splitfile group: 1

 

Now, my string variable is way larger than the length of the substring to be searched. Someone might point out for me what the matter can be in this case?

 

Thanks,

Luca 

 

Luca Meyer

 

Reply | Threaded
Open this post in threaded view
|

Re: INDEX & RINDEX function error

Albert-Jan Roskam
In reply to this post by Luca Meyer-3
Hi,

I want to randomly round numbers to multiples of a thousand. Is the syntax below the way to do this? I don't want the numbers to be consistently rounded up or down. Thanks in advance!

Cheers!!
Albert-Jan

data list free / x (f6).
begin data
121321
121011
128777
end data.

set seed = 12139.
numeric y (f12).
compute y = ( rnd ( (x + rv.uniform(-10**3, 10**3)) * 10**-3) ) * 10**3.

=====================
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: INDEX & RINDEX function error

Luca Meyer-3
In reply to this post by ViAnn Beadle
Ok, a couple of line of the syntax giving the warning are:

IF INDEX(UPCASE(GRUPPO),"LOW")>0 CLUSTER=1.
IF INDEX(UPCASE(GRUPPO),"HEAVY")>0 CLUSTER=2.

This is the result of display dictionary for the var GRUPPO:

Variable Information
Variable
Position
Label
Measurement Level
Column Width
Alignment
Print Format
Write Format
Gruppo
2
<none>
Nominal
30
Left
A90
A90
Variables in the working file

As you can see it is much wider than the 3 to 5 chars I am searching for....

Cheers,
Luca

Il giorno 20/apr/09, alle ore 16:45, ViAnn Beadle ha scritto:

You need to provide more details such as the actual syntax used along with the defined string widths for all variables used.
 
From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Luca Meyer
Sent: Monday, April 20, 2009 8:40 AM
To: [hidden email]
Subject: INDEX & RINDEX function error
 
Hi,
 
I have recently quite happily moved to PASW for Mac but I yet have to find complete compatibility with previous (Win) version.
 
What I am getting quite often is this kind of warning:
 
>Warning # 618
>The length of each test substring for the INDEX or RINDEX function is greater
>than the length of the string to be searched.  The result has been set to the
>system-missing value.
>Command line: 11893  Current case: 1  Current splitfile group: 1
 
Now, my string variable is way larger than the length of the substring to be searched. Someone might point out for me what the matter can be in this case?
 
Thanks,
Luca 
 
Luca Meyer
 

Reply | Threaded
Open this post in threaded view
|

Re: INDEX & RINDEX function error

ViAnn Beadle

Try this:

 

data list fixed / Gruppo 1-90 (a).

begin data

 

low

heavy

something else

end data.

IF INDEX(UPCASE(GRUPPO),"LOW")>0 CLUSTER=1.

IF INDEX(UPCASE(GRUPPO),"HEAVY")>0 CLUSTER=2.

LIST .

 

It works for me. Does it for you? What does that very first row of the data look like in the data editor?

 

From: Luca Meyer [mailto:[hidden email]]
Sent: Monday, April 20, 2009 11:26 PM
To: ViAnn Beadle
Cc: SPSSX-L
Subject: Re: INDEX & RINDEX function error

 

Ok, a couple of line of the syntax giving the warning are:

 

IF INDEX(UPCASE(GRUPPO),"LOW")>0 CLUSTER=1.

IF INDEX(UPCASE(GRUPPO),"HEAVY")>0 CLUSTER=2.

 

This is the result of display dictionary for the var GRUPPO:

 

Variable Information

 

Variable

Position

Label

Measurement Level

Column Width

Alignment

Print Format

Write Format

Gruppo

2

<none>

Nominal

30

Left

A90

A90

Variables in the working file

 

As you can see it is much wider than the 3 to 5 chars I am searching for....

 

Cheers,

Luca

 

Il giorno 20/apr/09, alle ore 16:45, ViAnn Beadle ha scritto:



You need to provide more details such as the actual syntax used along with the defined string widths for all variables used.

 

From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Luca Meyer
Sent: Monday, April 20, 2009 8:40 AM
To: [hidden email]
Subject: INDEX & RINDEX function error

 

Hi,

 

I have recently quite happily moved to PASW for Mac but I yet have to find complete compatibility with previous (Win) version.

 

What I am getting quite often is this kind of warning:

 

>Warning # 618
>The length of each test substring for the INDEX or RINDEX function is greater
>than the length of the string to be searched.  The result has been set to the
>system-missing value.

>Command line: 11893  Current case: 1  Current splitfile group: 1

 

Now, my string variable is way larger than the length of the substring to be searched. Someone might point out for me what the matter can be in this case?

 

Thanks,

Luca 

 

Luca Meyer

 

 

Reply | Threaded
Open this post in threaded view
|

Re: INDEX & RINDEX function error

Luca Meyer-3
I think I have found the bug. My setting was UNICODE=YES. I move it to UNICODE=OFF and the warning disappeared.
Thanks for the suggestion.
Luca

Il giorno 21/apr/09, alle ore 15:26, ViAnn Beadle ha scritto:

data list fixed / Gruppo 1-90 (a).
begin data
 
low
heavy
something else
end data.
IF INDEX(UPCASE(GRUPPO),"LOW")>0 CLUSTER=1.
IF INDEX(UPCASE(GRUPPO),"HEAVY")>0 CLUSTER=2.
LIST .