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 (September 2007)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 20 Sep 2007 19:54:03 -0600
Reply-To:     ViAnn Beadle <vab88011@gmail.com>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         ViAnn Beadle <vab88011@gmail.com>
Subject:      Re: Recoding Question
Comments: To: Craig Johnson <cjohns38@gmail.com>
In-Reply-To:  <bfed04db0709201823g4787f99cq296d1ff16ee9c424@mail.gmail.com>
Content-Type: text/plain; charset="us-ascii"

I'm not sure why you're going through value labels to create strings but you can create the string directly from your numeric variable. Let's assume, in the simple case, I have a numeric variable call numvalue taking on values 1 through 10. Then

string newstring (a8). compute newstring =concat("Value ", string(numvalue - 100,f3)).

This will produce a new string variable with values like Value 1. What is important here, based upon your earlier post is that the first argument to numvalue is any numeric expression so you could have something like string(numvalue-1 * 10 + 139, f3). Note that the second argument to the string function is the numeric format to use when composing the string.

Without seeing the actual error message and the syntax run it's really hard to diagnose why your master include is not working. Note that the INCLUDE command requires that all commands start in column 1 and that any continuations to the commands NOT start in column 1 so if you have syntax like that below within a file named on the INCLUDE command, it will generate an error. Use the INSERT command instead.

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Craig Johnson Sent: Thursday, September 20, 2007 7:24 PM To: SPSSX-L@LISTSERV.UGA.EDU Subject: Recoding Question

I'm currently running a bunch of analyses across several studies. To accomplish what I need to I calculate a variable, recode a variable, add 132 value labels on each of the datasets, convert the value labels to strings, and then transpose things so cases become variables. (It is some what complicated to explain so won't get into it much.but the jist is I'm using OMS to export data, manipulating it so I can run analyses on it and then merging a bunch of results together.) I have created syntax to do this for each data set and everything works well. I have also set up a secondary syntax that uses an Include statement for each of the other syntax files I have created to relabel each data set. By doing this I can use nested syntax files and use a single file to call all 42 of the other syntax files I need run to relabel a variable.

Currently I can run each single syntax file independently and it adds values labels properly. However when I try and run this in the "batch" syntax file, which calls the other syntax files, I get an error for the value labels. So..just to be clear.it runs fine if I run them individually but when I try and run them all through a single file with include statements I get errors on the value labels. I believe this may be a function of SPSS being sensitive to how things are configured when running nested syntax files. I was wondering if anyone has some insight into what might be wrong. Below is a copy of how the value labels is set up..any help would be appreciated.

Value Labels New 101 'Value 1' 102 'Value 2' 103 'Value 3' 104 'Value 4' 105 'Value 5' 106 'Value 6' 107 'Value 7' 108 'Value 8' 109 'Value 9' 110 'Value 10' 111 'Value 11' 112 'Value 12' 113 'Value 13' 114 'Value 14' 115 'Value 15'.


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