Fwd: Unknown variable type

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

Fwd: Unknown variable type

Rajeshms


---------- Forwarded message ----------
From: Rajeshms <[hidden email]>
Date: Thu, Oct 4, 2012 at 5:56 PM
Subject: Unknown variable type
To: [hidden email]


Hi all,

SPSS 21, win 7.

I pulled the data from SQL database, but for one variable I am not getting its variable type.If I try to change the empty to any other type,i get a message that
"The variable type can be changed only using the syntax"
so how to write a syntax to change the variable type to any other type.

thanks all,

--
Rajesh M S






--
Rajesh M S



Reply | Threaded
Open this post in threaded view
|

Re: Fwd: Unknown variable type

Bruce Weaver
Administrator
Have you tried ALTER TYPE?

ALTER TYPE varname (desired_type).


Rajeshms wrote
---------- Forwarded message ----------
From: Rajeshms <[hidden email]>
Date: Thu, Oct 4, 2012 at 5:56 PM
Subject: Unknown variable type
To: [hidden email]


Hi all,

SPSS 21, win 7.

I pulled the data from SQL database, but for one variable I am not getting
its variable type.If I try to change the empty to any other type,i get a
message that
"The variable type can be changed only using the syntax"
so how to write a syntax to change the variable type to any other type.

thanks all,

--
Rajesh M S






--
Rajesh M S
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Unknown variable type [Was: Measure type changing]

John F Hall
In reply to this post by Rajeshms

I’ve already answered this once, but you’ve changed the subject heading.   Please stick to the same heading which was:

 

Measure type changing

 

From data editor click on;

 

Help >> Command Syntax Reference

Scroll down to VARIABLE LEVEL

 

Manual page 2154 says:

 

VARIABLE LEVEL varlist ({SCALE }) ... [/varlist...]

{ORDINAL}

{NOMINAL}

This command takes effect immediately. It does not read the active dataset or execute pending

transformations. For more information, see the topic Command Order on p. 41.

Example

VARIABLE LEVEL sales95 sales96 (SCALE)

/region division (NOMINAL)

/expense (ORDINAL).

 

Easy when you know how!  As David Marso never tires of saying, always RTFM.

 

 

John F Hall (Mr)

 

Email:     [hidden email]

Website: www.surveyresearch.weebly.com

 

 

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Rajeshms
Sent: 04 October 2012 14:28
To: [hidden email]
Subject: Fwd: Unknown variable type

 

 

---------- Forwarded message ----------
From: Rajeshms <[hidden email]>
Date: Thu, Oct 4, 2012 at 5:56 PM
Subject: Unknown variable type
To: [hidden email]


Hi all,

 

SPSS 21, win 7.

 

I pulled the data from SQL database, but for one variable I am not getting its variable type.If I try to change the empty to any other type,i get a message that

"The variable type can be changed only using the syntax"

so how to write a syntax to change the variable type to any other type.

 

thanks all,

 

--

Rajesh M S

 

 

 



 

--

Rajesh M S

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Unknown variable type [Was: Measure type changing]

John F Hall
In reply to this post by Rajeshms
Senior moment there: been up since 03:00 working SPSS files from major
government survey.  Ignore my previous message and listen to Bruce.
Cringing apologies all round.



ALTER TYPE is on page 175 of the manual.





John F Hall (Mr)



Email:     [hidden email]

Website: www.surveyresearch.weebly.com <http://surveyresearch.weebly.com/>











From: John F Hall [mailto:[hidden email]]
Sent: 04 October 2012 16:59
To: 'Rajeshms'; [hidden email]
Subject: RE: Unknown variable type [Was: Measure type changing]



I've already answered this once, but you've changed the subject heading.
Please stick to the same heading which was:



Measure type changing



From data editor click on;



Help >> Command Syntax Reference

Scroll down to VARIABLE LEVEL



Manual page 2154 says:



VARIABLE LEVEL varlist ({SCALE }) ... [/varlist...]

{ORDINAL}

{NOMINAL}

This command takes effect immediately. It does not read the active dataset
or execute pending

transformations. For more information, see the topic Command Order on p. 41.

Example

VARIABLE LEVEL sales95 sales96 (SCALE)

/region division (NOMINAL)

/expense (ORDINAL).



Easy when you know how!  As David Marso never tires of saying, always RTFM.





John F Hall (Mr)



Email:     [hidden email]

Website: www.surveyresearch.weebly.com <http://surveyresearch.weebly.com/>







From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of
Rajeshms
Sent: 04 October 2012 14:28
To: [hidden email]
Subject: Fwd: Unknown variable type





---------- Forwarded message ----------
From: Rajeshms <[hidden email]>
Date: Thu, Oct 4, 2012 at 5:56 PM
Subject: Unknown variable type
To: [hidden email]


Hi all,



SPSS 21, win 7.



I pulled the data from SQL database, but for one variable I am not getting
its variable type.If I try to change the empty to any other type,i get a
message that

"The variable type can be changed only using the syntax"

so how to write a syntax to change the variable type to any other type.



thanks all,



--

Rajesh M S













--

Rajesh M S

=====================
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: Fwd: Unknown variable type

Richard Ristow
In reply to this post by Rajeshms
At 08:27 AM 10/4/2012, Rajeshms wrote:

>I pulled the data from SQL database, but for one variable I am not
>getting its variable type.

Once it's in SPSS, if you look at the Variable View in the Data
Editor, you should see what SPSS thinks its type is. Does that help?

=====================
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: Fwd: Unknown variable type

Rajeshms
Hi all,

I was able to do using the cast (variable name as nchar())...........,so is this a good /correct way?

On Fri, Oct 5, 2012 at 7:46 PM, Richard Ristow <[hidden email]> wrote:
At 08:27 AM 10/4/2012, Rajeshms wrote:

I pulled the data from SQL database, but for one variable I am not getting its variable type.

Once it's in SPSS, if you look at the Variable View in the Data Editor, you should see what SPSS thinks its type is. Does that help?




--
Rajesh M S