LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (June 2002)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 5 Jun 2002 10:49:02 -0300
Reply-To:     Marcos Sanches <marcos_sanches@gallup.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         Marcos Sanches <marcos_sanches@gallup.com>
Subject:      Re: coding (quick help? Thanks!!)
Comments: To: yiya Chen <yiyachen@YAHOO.COM>
In-Reply-To:  <20020604214855.11733.qmail@web9106.mail.yahoo.com>
Content-Type: text/plain; charset="iso-8859-1"

Hello Yiya,

If you want to code cases based on two positions of a string variables, you can use:

IF (SUBSTR(v1,7,1) = "1" and SUBSTR(v1,4,1) = "1" ) codevar=1. IF (SUBSTR(v1,7,1) = "1" and SUBSTR(v1,4,1) = "2" ) codevar=2. exe.

I don't know if I understood your problem,

Marcos

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU]On Behalf Of yiya Chen Sent: Tuesday, June 04, 2002 6:49 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: coding (quick help? Thanks!!)

Dear all,

Can anyone kindly help me with the following problem:

I have been trying to use syntax to encode my data. In the usual case, I know how to do it. For example,

IF (SUBSTR(v1,7,1) = "1") REPETITION=rep1. (if the seventh character in the name string contaiins the number 1, encode it under the variable repetition as 1.

Now, my problem is: there are certain cases the specific encoding has to be dependent on two characters rather than 1. For example, I have these two file names which only differ in the 4th character:

Wfd1f62

Wfd2f62

But I need to encode the d as two different categories under the same variable. Hypothetically speaking, when it is "d1", it is da and when it is "d2", it is di under the same variable "word".

Can anyone kindly advise me what I should do? Very big thanks!!

Best,

Yiya Chen

--------------------------------- Do You Yahoo!? Sign-up for Video Highlights of 2002 FIFA World Cup


Back to: Top of message | Previous page | Main SPSSX-L page