looping error

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

looping error

Manmit Shrimali-2
Hello experts:

I will appreciate if you could provide your expertise in the following.
Following are the variables:

City name (Numeric): 49 variables: city name coded as 1 - if selected, 0
if not selected.

Hotel variable(string): 49 variables asking hotel name. I.e. when user
responds 1 in city name he will have to type the hotel he stayed in the
city.

In the process of data cleaning, I would like to check that there should
be a value in hotel name if city name is selected i.e. 1. Also, check
reverse, i.e. there should be value in hotel name only if city name is
selected.

I could use if function for e.g.
Temporary.
If cityname=1 and hotelname=" " error=1.
If hotelname ne " " and cityname~=1 error1=1.
Cross error to error1 by id.

However, I have 49 variables so I will have to write 98 if statements.
Is there any easy way around?

Any help is highly appreciated.

Thanks,
Reply | Threaded
Open this post in threaded view
|

Re: looping error

Peck, Jon
For the kind of checking you are doing, the Data Validation option for SPSS would be very helpful.  Besides letting you define rules that can be applied to many variables and are saved with your data for reapplication, it produces useful reports and calculates variables in the dataset reflecting the outcome of the rule tests.

HTH,
Jon Peck
SPSS

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Manmit Shrimali
Sent: Sunday, October 22, 2006 5:33 PM
To: [hidden email]
Subject: [SPSSX-L] looping error

Hello experts:

I will appreciate if you could provide your expertise in the following.
Following are the variables:

City name (Numeric): 49 variables: city name coded as 1 - if selected, 0
if not selected.

Hotel variable(string): 49 variables asking hotel name. I.e. when user
responds 1 in city name he will have to type the hotel he stayed in the
city.

In the process of data cleaning, I would like to check that there should
be a value in hotel name if city name is selected i.e. 1. Also, check
reverse, i.e. there should be value in hotel name only if city name is
selected.

I could use if function for e.g.
Temporary.
If cityname=1 and hotelname=" " error=1.
If hotelname ne " " and cityname~=1 error1=1.
Cross error to error1 by id.

However, I have 49 variables so I will have to write 98 if statements.
Is there any easy way around?

Any help is highly appreciated.

Thanks,
Reply | Threaded
Open this post in threaded view
|

Find/find and replace problem on 14

Maguin, Eugene
In reply to this post by Manmit Shrimali-2
All,

I would like to know if anybody has encountered problems with either the
Find (ctrl-f) or find-and-replace (ctrl-h) on the patched up, but not
including the hotfix, version of 14. 14 was put on at the end of September
and I have noticed on several occasions since then an intermittent and, as
yet, non-reproducible error. I have two computers, both Dells, one running
98 and the other XP. The error has occurred on both. The error is that Find
and Find-and-Replace (F&R) stop working. That is, the search string is no
longer recognized even though it continues to exist in the file. Closing and
re-opening the Find/F&R box has no effect. Searching for another string also
fails. The only solution is to close spss and restart it. Since this has
happened on both of my computers and is repaired by restarting spss, I am
inclined to discount the computer as the cause and to point my finger at
spss. Although I am going to send this to tech support, I'd like to know if
anybody else has experienced this problem.

Gene Maguin
Reply | Threaded
Open this post in threaded view
|

Re: Find/find and replace problem on 14

Marks, Jim
Yes-- minor annoyance in terms of productivity. Very aggrivating to see
the "not found" msg, when I can see the search string.

No ideas about conditions leading to it

--jim

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Gene Maguin
Sent: Monday, October 23, 2006 10:10 AM
To: [hidden email]
Subject: Find/find and replace problem on 14

All,

I would like to know if anybody has encountered problems with either the
Find (ctrl-f) or find-and-replace (ctrl-h) on the patched up, but not
including the hotfix, version of 14. 14 was put on at the end of
September and I have noticed on several occasions since then an
intermittent and, as yet, non-reproducible error. I have two computers,
both Dells, one running
98 and the other XP. The error has occurred on both. The error is that
Find and Find-and-Replace (F&R) stop working. That is, the search string
is no longer recognized even though it continues to exist in the file.
Closing and re-opening the Find/F&R box has no effect. Searching for
another string also fails. The only solution is to close spss and
restart it. Since this has happened on both of my computers and is
repaired by restarting spss, I am inclined to discount the computer as
the cause and to point my finger at spss. Although I am going to send
this to tech support, I'd like to know if anybody else has experienced
this problem.

Gene Maguin