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 (July 2006)Back to main SPSSX-L pageJoin or leave SPSSX-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
=========================================================================
Date:         Fri, 28 Jul 2006 08:08:55 -0500
Reply-To:     "Oliver, Richard" <roliver@SPSS.COM>
Sender:       "SPSSX(r) Discussion" <SPSSX-L@LISTSERV.UGA.EDU>
From:         "Oliver, Richard" <roliver@SPSS.COM>
Subject:      Re: SV: Variable length to maximum
Comments: To: Staffan Lindberg <staffan.lindberg@anastat.se>
Content-Type: text/plain; charset="iso-8859-1"

Using Python in SPSS 14, you can build lists of variables based on type (e.g., string vs. numeric) and use those lists of variable names in commands -- but you cannot change the defined width of a string variable via syntax. (The ability to change the defined width of a sting variable in the Data Editor is not directly supported in syntax, although there is a workaround that involves creating new string variables of the desired width and then deleting the old ones).

Are you trying to set the print/write format of the variables, or just the width of the Data Editor columns? For the latter, you would use VARIABLE WIDTH, which doesn't care about data type or format.

-----Original Message----- From: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] On Behalf Of Staffan Lindberg Sent: Friday, July 28, 2006 7:48 AM To: SPSSX-L@LISTSERV.UGA.EDU Subject: SV: Variable length to maximum

OK!

You can use the TO functions when the variables are consecutively placed (numerical or string) i.e.

Format Varnum1 to VarnumX (F40.0). Format Varstring1 to VarstringX (A255).

This can be somewhat tedious, if you have every other numerical and every other string. Perhaps it is possible to use a script or something similar. Perhaps some script wizard on the list could help you.

best

Staffan Lindberg National Institute of Public Health Sweden

-----Ursprungligt meddelande----- Från: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] För Manmit Shrimali Skickat: den 28 juli 2006 14:35 Till: SPSSX-L@LISTSERV.UGA.EDU Ämne: Re: Variable length to maximum

Thanks staffan but the problem is that I need to do for all variables. I have 550 numeric variables and 39 string variables. Can I use something like all varnum and all var string etc..

Please help.

-----Original Message----- From: Staffan Lindberg [mailto:staffan.lindberg@anastat.se] Sent: Friday, July 28, 2006 5:59 PM To: Manmit Shrimali; SPSSX-L@LISTSERV.UGA.EDU Subject: SV: Variable length to maximum

You can do this with the FORMAT statement, i.e.

FORMAT VARNUM (F40.0). FORMAT VARSTRING (A255).

best

Staffan Lindberg National Institute of Public Health Sweden

-----Ursprungligt meddelande----- Från: SPSSX(r) Discussion [mailto:SPSSX-L@LISTSERV.UGA.EDU] För Manmit Shrimali Skickat: den 28 juli 2006 14:21 Till: SPSSX-L@LISTSERV.UGA.EDU Ämne: Variable length to maximum

This is rather very simple question. However, after lot of research I still could not find the answer. Can please anyone provide me syntax for setting the variable length to maximum i.e numeric to 40 and string to 255.

Right now I have to manually go in width column of variable view and set it to maximum. I have to set it to maximum as when I have wave 2 data to merge, the length should be the same.

Thanks in advance.


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