SPSS20 64bit We have a little problem, changing String into Numeric. Example: Variable_X (A10). 1.234 2 3 By using <ALTER TYPE Variable_X (F8.2)> only the integers survive, whereas 1.234 becomes a missing value. We normally use an installation in german language, but use the following syntax before: SET DIGITGROUPING=No Small=0.0001 Unicode=No OLang=English. We also tried to change the "measurement system" in the the options dialogue to set to inches or points. However, it doesn't work. Any help welcome. Thanks
Dr. Frank Gaeth
|
The problem is likely that your locale
is German which implies that the decimal point is a comma, but your data
use a period as the decimal.
The locale setting is taken by default from the OS and is not related to the user interface or output languages. You can either use a comma as the decimal or change the locale to one where a period is the decimal such as english, or use format DOT in your ALTER TYPE command, e.g. alter type x(dot8.2). dot format actually means a comma decimal. The name comes from the digit grouping character, which would be a period in this example. HTH, Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: drfg2008 <[hidden email]> To: [hidden email] Date: 10/11/2012 09:27 AM Subject: [SPSSX-L] ALTER TYPE Sent by: "SPSSX(r) Discussion" <[hidden email]> SPSS20 64bit We have a little problem, changing String into Numeric. Example: Variable_X (A10). 1.234 2 3 By using <ALTER TYPE Variable_X (F8.2)> only the integers survive, whereas 1.234 becomes a missing value. We normally use an installation in german language, but use the following syntax before: SET DIGITGROUPING=No Small=0.0001 Unicode=No OLang=English. We also tried to change the "measurement system" in the the options dialogue to set to inches or points. However, it doesn't work. Any help welcome. Thanks ----- Dr. Frank Gaeth FU-Berlin -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/ALTER-TYPE-tp5715594.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== 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 |
In reply to this post by drfg2008
I'm going to guess that your running in
a locale in which a comma rather than a period is the decimal indicator.
Therefore, the value with the period won't be recognized as a valid number.
So try this instead:
alter type variable_x (Comma8.2). Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] Phone: 312.893.4922 | T/L: 206-4922 From: drfg2008 <[hidden email]> To: [hidden email], Date: 10/11/2012 10:25 AM Subject: ALTER TYPE Sent by: "SPSSX(r) Discussion" <[hidden email]> SPSS20 64bit We have a little problem, changing String into Numeric. Example: Variable_X (A10). 1.234 2 3 By using <ALTER TYPE Variable_X (F8.2)> only the integers survive, whereas 1.234 becomes a missing value. We normally use an installation in german language, but use the following syntax before: SET DIGITGROUPING=No Small=0.0001 Unicode=No OLang=English. We also tried to change the "measurement system" in the the options dialogue to set to inches or points. However, it doesn't work. Any help welcome. Thanks ----- Dr. Frank Gaeth FU-Berlin -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/ALTER-TYPE-tp5715594.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== 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 |
In reply to this post by Jon K Peck
Rick is right. It should be
comma8.2 below.
Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: Jon K Peck/Chicago/IBM@IBMUS To: [hidden email] Date: 10/11/2012 10:43 AM Subject: Re: [SPSSX-L] ALTER TYPE Sent by: "SPSSX(r) Discussion" <[hidden email]> The problem is likely that your locale is German which implies that the decimal point is a comma, but your data use a period as the decimal. The locale setting is taken by default from the OS and is not related to the user interface or output languages. You can either use a comma as the decimal or change the locale to one where a period is the decimal such as english, or use format DOT in your ALTER TYPE command, e.g. alter type x(dot8.2). dot format actually means a comma decimal. The name comes from the digit grouping character, which would be a period in this example. HTH, Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: drfg2008 <[hidden email]> To: [hidden email] Date: 10/11/2012 09:27 AM Subject: [SPSSX-L] ALTER TYPE Sent by: "SPSSX(r) Discussion" <[hidden email]> SPSS20 64bit We have a little problem, changing String into Numeric. Example: Variable_X (A10). 1.234 2 3 By using <ALTER TYPE Variable_X (F8.2)> only the integers survive, whereas 1.234 becomes a missing value. We normally use an installation in german language, but use the following syntax before: SET DIGITGROUPING=No Small=0.0001 Unicode=No OLang=English. We also tried to change the "measurement system" in the the options dialogue to set to inches or points. However, it doesn't work. Any help welcome. Thanks ----- Dr. Frank Gaeth FU-Berlin -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/ALTER-TYPE-tp5715594.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== 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 |
Yes, that solved the problem. Thanks
Dr. Frank Gaeth
|
In reply to this post by Jon K Peck
Hello,
I've found something strange about comma format. My problem was similiar to the topic starter's problem: we're using a locale where the decimal indicator is a comma. However, there are quite a few computers at our company where the decimal indicator is a dot. We don't use grouping characters at all. So I was trying to come up with a way to ensure that no matter what the input is (whether it has dot or comma as decimal point indicator) and no matter what the spss locale is, the data gets read in. I've made a few experiments and I'm getting confused. Throughout the experiment, "Alma" is the string variable the input is read into. *(1) Number with dot - data is read in just fine. String Alma(A8). compute Alma = "123.45". compute Barack = Number(Alma, comma8.2). execute. FREQUENCIES Alma Barack. delete variables Alma Barack. *(2) Number with comma - data is read in just fine. String Alma(A8). compute Alma = "123,45". compute Barack = Number(Alma, comma8.2). execute. FREQUENCIES Alma Barack. delete variables Alma Barack. *(3) Number with comma grouping and dot decimal indicator - data is read in just fine. String Alma(A8). compute Alma = "1,234.56". compute Barack = Number(Alma, comma8.2). execute. FREQUENCIES Alma Barack. delete variables Alma Barack. *(4) Number with comma grouping and dot decimal indicator - I get a missing case. String Alma(A8). compute Alma = "1.234,56". compute Barack = Number(Alma, comma8.2). execute. FREQUENCIES Alma Barack. delete variables Alma Barack. delete variables Alma Barack. Now what I find surprising is (1) and (2). It seems to me that when the program seems only one separator, it assumes that it's the decimal place indicator, no matter what. Is this the intended behaviour? In this case it helps me a lot, as it seems that I've got the solution for my 'problem', but there might be something here that I'm missing or misunderstanding. Tried the same with alter type and the result is very much different. (1) I get the intended result (123.45) (2) I get 12345 (12,345.00, to be precise) (3) and (4) works the same (correct result / sysmis) Can someone help me sort out how all this is supposed to work? |
Hello,
You can also use SET LOCALE (with PRESERVE and RESTORE, if you like) to have control over this. Regards, Albert-Jan ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ All right, but apart from the sanitation, the medicine, education, wine, public order, irrigation, roads, a fresh water system, and public health, what have the Romans ever done for us? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ----- Original Message ----- > From: csarmi <[hidden email]> > To: [hidden email] > Cc: > Sent: Wednesday, November 14, 2012 1:41 PM > Subject: Re: [SPSSX-L] ALTER TYPE > > Hello, > > I've found something strange about comma format. > My problem was similiar to the topic starter's problem: we're using a > locale > where the decimal indicator is a comma. > > However, there are quite a few computers at our company where the decimal > indicator is a dot. > > We don't use grouping characters at all. > > So I was trying to come up with a way to ensure that no matter what the > input is (whether it has dot or comma as decimal point indicator) and no > matter what the spss locale is, the data gets read in. > > I've made a few experiments and I'm getting confused. Throughout the > experiment, "Alma" is the string variable the input is read into. > > *(1) Number with dot - data is read in just fine. > String Alma(A8). > compute Alma = "123.45". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(2) Number with comma - data is read in just fine. > String Alma(A8). > compute Alma = "123,45". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(3) Number with comma grouping and dot decimal indicator - data is read in > just fine. > String Alma(A8). > compute Alma = "1,234.56". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(4) Number with comma grouping and dot decimal indicator - I get a missing > case. > String Alma(A8). > compute Alma = "1.234,56". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > delete variables Alma Barack. > > Now what I find surprising is (1) and (2). It seems to me that when the > program seems only one separator, it assumes that it's the decimal place > indicator, no matter what. > > Is this the intended behaviour? In this case it helps me a lot, as it seems > that I've got the solution for my 'problem', but there might be > something > here that I'm missing or misunderstanding. > > Tried the same with alter type and the result is very much different. > > (1) I get the intended result (123.45) > (2) I get 12345 (12,345.00, to be precise) > (3) and (4) works the same (correct result / sysmis) > > Can someone help me sort out how all this is supposed to work? > > > > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/ALTER-TYPE-tp5715594p5716184.html > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > 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 > ===================== 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 |
In reply to this post by csarmi
DOT and COMMA formats are locale invariant
by definition.
Run this code to see what is happening with the Number function. compute Barack = Number(Alma, comma8.2). compute Barack2 = Number(Alma, dot8.2). compute Barack3 = Number(Alma, comma10.4). compute Barack4= Number(Alma, dot10.4). list. In the absence of the appropriate decimal symbol, the decimal specifications in the format control the result. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: csarmi <[hidden email]> To: [hidden email], Date: 11/14/2012 05:42 AM Subject: Re: [SPSSX-L] ALTER TYPE Sent by: "SPSSX(r) Discussion" <[hidden email]> Hello, I've found something strange about comma format. My problem was similiar to the topic starter's problem: we're using a locale where the decimal indicator is a comma. However, there are quite a few computers at our company where the decimal indicator is a dot. We don't use grouping characters at all. So I was trying to come up with a way to ensure that no matter what the input is (whether it has dot or comma as decimal point indicator) and no matter what the spss locale is, the data gets read in. I've made a few experiments and I'm getting confused. Throughout the experiment, "Alma" is the string variable the input is read into. *(1) Number with dot - data is read in just fine. String Alma(A8). compute Alma = "123.45". compute Barack = Number(Alma, comma8.2). execute. FREQUENCIES Alma Barack. delete variables Alma Barack. *(2) Number with comma - data is read in just fine. String Alma(A8). compute Alma = "123,45". compute Barack = Number(Alma, comma8.2). execute. FREQUENCIES Alma Barack. delete variables Alma Barack. *(3) Number with comma grouping and dot decimal indicator - data is read in just fine. String Alma(A8). compute Alma = "1,234.56". compute Barack = Number(Alma, comma8.2). execute. FREQUENCIES Alma Barack. delete variables Alma Barack. *(4) Number with comma grouping and dot decimal indicator - I get a missing case. String Alma(A8). compute Alma = "1.234,56". compute Barack = Number(Alma, comma8.2). execute. FREQUENCIES Alma Barack. delete variables Alma Barack. delete variables Alma Barack. Now what I find surprising is (1) and (2). It seems to me that when the program seems only one separator, it assumes that it's the decimal place indicator, no matter what. Is this the intended behaviour? In this case it helps me a lot, as it seems that I've got the solution for my 'problem', but there might be something here that I'm missing or misunderstanding. Tried the same with alter type and the result is very much different. (1) I get the intended result (123.45) (2) I get 12345 (12,345.00, to be precise) (3) and (4) works the same (correct result / sysmis) Can someone help me sort out how all this is supposed to work? -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/ALTER-TYPE-tp5715594p5716184.html Sent from the SPSSX Discussion mailing list archive at Nabble.com. ===================== 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 |
Thanks Jon,
I see. So this doesn't help me afterall, unless the decimal indicator is always at the same place AND I know where it is :) So I'm left with preserve - set locale - restore as solution. Máté 2012/11/14 Jon K Peck [via SPSSX Discussion] <[hidden email]>: > DOT and COMMA formats are locale invariant by definition. > > Run this code to see what is happening with the Number function. > compute Barack = Number(Alma, comma8.2). > compute Barack2 = Number(Alma, dot8.2). > compute Barack3 = Number(Alma, comma10.4). > compute Barack4= Number(Alma, dot10.4). > list. > > In the absence of the appropriate decimal symbol, the decimal specifications > in the format control the result. > > Jon Peck (no "h") aka Kim > Senior Software Engineer, IBM > [hidden email] > new phone: 720-342-5621 > > > > > From: csarmi <[hidden email]> > To: [hidden email], > Date: 11/14/2012 05:42 AM > Subject: Re: [SPSSX-L] ALTER TYPE > Sent by: "SPSSX(r) Discussion" <[hidden email]> > ________________________________ > > > > Hello, > > I've found something strange about comma format. > My problem was similiar to the topic starter's problem: we're using a locale > where the decimal indicator is a comma. > > However, there are quite a few computers at our company where the decimal > indicator is a dot. > > We don't use grouping characters at all. > > So I was trying to come up with a way to ensure that no matter what the > input is (whether it has dot or comma as decimal point indicator) and no > matter what the spss locale is, the data gets read in. > > I've made a few experiments and I'm getting confused. Throughout the > experiment, "Alma" is the string variable the input is read into. > > *(1) Number with dot - data is read in just fine. > String Alma(A8). > compute Alma = "123.45". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(2) Number with comma - data is read in just fine. > String Alma(A8). > compute Alma = "123,45". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(3) Number with comma grouping and dot decimal indicator - data is read in > just fine. > String Alma(A8). > compute Alma = "1,234.56". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(4) Number with comma grouping and dot decimal indicator - I get a missing > case. > String Alma(A8). > compute Alma = "1.234,56". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > delete variables Alma Barack. > > Now what I find surprising is (1) and (2). It seems to me that when the > program seems only one separator, it assumes that it's the decimal place > indicator, no matter what. > > Is this the intended behaviour? In this case it helps me a lot, as it seems > that I've got the solution for my 'problem', but there might be something > here that I'm missing or misunderstanding. > > Tried the same with alter type and the result is very much different. > > (1) I get the intended result (123.45) > (2) I get 12345 (12,345.00, to be precise) > (3) and (4) works the same (correct result / sysmis) > > Can someone help me sort out how all this is supposed to work? > > > > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/ALTER-TYPE-tp5715594p5716184.html > > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > 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 > > > > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > http://spssx-discussion.1045642.n5.nabble.com/ALTER-TYPE-tp5715594p5716187.html > To unsubscribe from ALTER TYPE, click here. > NAML |
In reply to this post by Jon K Peck
Hi again,
No I'm not. Locale invariance is my friend. *1. String Alma1 A(8). compute Alma1 = "123.45". compute Alma1 = Replace(Alma1, ",", "."). compute Barack1 = Number(Alma1, comma8.2). *2. String Alma2 A(8). compute Alma2 = "123,45". compute Alma2 = Replace(Alma2, ",", "."). compute Barack2 = Number(Alma2, comma8.2). (I suppose the same can be done with Alter Type and this is gonna work as long as there are no grouping symbols) Máté 2012/11/14 Jon K Peck [via SPSSX Discussion] <[hidden email]>: > DOT and COMMA formats are locale invariant by definition. > > Run this code to see what is happening with the Number function. > compute Barack = Number(Alma, comma8.2). > compute Barack2 = Number(Alma, dot8.2). > compute Barack3 = Number(Alma, comma10.4). > compute Barack4= Number(Alma, dot10.4). > list. > > In the absence of the appropriate decimal symbol, the decimal specifications > in the format control the result. > > Jon Peck (no "h") aka Kim > Senior Software Engineer, IBM > [hidden email] > new phone: 720-342-5621 > > > > > From: csarmi <[hidden email]> > To: [hidden email], > Date: 11/14/2012 05:42 AM > Subject: Re: [SPSSX-L] ALTER TYPE > Sent by: "SPSSX(r) Discussion" <[hidden email]> > ________________________________ > > > > Hello, > > I've found something strange about comma format. > My problem was similiar to the topic starter's problem: we're using a locale > where the decimal indicator is a comma. > > However, there are quite a few computers at our company where the decimal > indicator is a dot. > > We don't use grouping characters at all. > > So I was trying to come up with a way to ensure that no matter what the > input is (whether it has dot or comma as decimal point indicator) and no > matter what the spss locale is, the data gets read in. > > I've made a few experiments and I'm getting confused. Throughout the > experiment, "Alma" is the string variable the input is read into. > > *(1) Number with dot - data is read in just fine. > String Alma(A8). > compute Alma = "123.45". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(2) Number with comma - data is read in just fine. > String Alma(A8). > compute Alma = "123,45". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(3) Number with comma grouping and dot decimal indicator - data is read in > just fine. > String Alma(A8). > compute Alma = "1,234.56". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(4) Number with comma grouping and dot decimal indicator - I get a missing > case. > String Alma(A8). > compute Alma = "1.234,56". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > delete variables Alma Barack. > > Now what I find surprising is (1) and (2). It seems to me that when the > program seems only one separator, it assumes that it's the decimal place > indicator, no matter what. > > Is this the intended behaviour? In this case it helps me a lot, as it seems > that I've got the solution for my 'problem', but there might be something > here that I'm missing or misunderstanding. > > Tried the same with alter type and the result is very much different. > > (1) I get the intended result (123.45) > (2) I get 12345 (12,345.00, to be precise) > (3) and (4) works the same (correct result / sysmis) > > Can someone help me sort out how all this is supposed to work? > > > > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/ALTER-TYPE-tp5715594p5716184.html > > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > 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 > > > > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > http://spssx-discussion.1045642.n5.nabble.com/ALTER-TYPE-tp5715594p5716187.html > To unsubscribe from ALTER TYPE, click here. > NAML |
In reply to this post by csarmi
The problem with SET LOCALE is that you
can't have any open datasets when you change the locale. If the decimal
indicator is the only issue, then SET DECIMAL should work.
Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] From: csarmi <[hidden email]> To: [hidden email], Date: 11/14/2012 09:35 AM Subject: Re: ALTER TYPE Sent by: "SPSSX(r) Discussion" <[hidden email]> Thanks Jon, I see. So this doesn't help me afterall, unless the decimal indicator is always at the same place AND I know where it is :) So I'm left with preserve - set locale - restore as solution. Máté 2012/11/14 Jon K Peck [via SPSSX Discussion] <[hidden email]>: > DOT and COMMA formats are locale invariant by definition. > > Run this code to see what is happening with the Number function. > compute Barack = Number(Alma, comma8.2). > compute Barack2 = Number(Alma, dot8.2). > compute Barack3 = Number(Alma, comma10.4). > compute Barack4= Number(Alma, dot10.4). > list. > > In the absence of the appropriate decimal symbol, the decimal specifications > in the format control the result. > > Jon Peck (no "h") aka Kim > Senior Software Engineer, IBM > [hidden email] > new phone: 720-342-5621 > > > > > From: csarmi <[hidden email]> > To: [hidden email], > Date: 11/14/2012 05:42 AM > Subject: Re: [SPSSX-L] ALTER TYPE > Sent by: "SPSSX(r) Discussion" <[hidden email]> > ________________________________ > > > > Hello, > > I've found something strange about comma format. > My problem was similiar to the topic starter's problem: we're using a locale > where the decimal indicator is a comma. > > However, there are quite a few computers at our company where the decimal > indicator is a dot. > > We don't use grouping characters at all. > > So I was trying to come up with a way to ensure that no matter what the > input is (whether it has dot or comma as decimal point indicator) and no > matter what the spss locale is, the data gets read in. > > I've made a few experiments and I'm getting confused. Throughout the > experiment, "Alma" is the string variable the input is read into. > > *(1) Number with dot - data is read in just fine. > String Alma(A8). > compute Alma = "123.45". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(2) Number with comma - data is read in just fine. > String Alma(A8). > compute Alma = "123,45". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(3) Number with comma grouping and dot decimal indicator - data is read in > just fine. > String Alma(A8). > compute Alma = "1,234.56". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > > *(4) Number with comma grouping and dot decimal indicator - I get a missing > case. > String Alma(A8). > compute Alma = "1.234,56". > compute Barack = Number(Alma, comma8.2). > execute. > FREQUENCIES Alma Barack. > delete variables Alma Barack. > delete variables Alma Barack. > > Now what I find surprising is (1) and (2). It seems to me that when the > program seems only one separator, it assumes that it's the decimal place > indicator, no matter what. > > Is this the intended behaviour? In this case it helps me a lot, as it seems > that I've got the solution for my 'problem', but there might be something > here that I'm missing or misunderstanding. > > Tried the same with alter type and the result is very much different. > > (1) I get the intended result (123.45) > (2) I get 12345 (12,345.00, to be precise) > (3) and (4) works the same (correct result / sysmis) > > Can someone help me sort out how all this is supposed to work? > > > > -- > View this message in context: > http://spssx-discussion.1045642.n5.nabble.com/ALTER-TYPE-tp5715594p5716184.html > > Sent from the SPSSX Discussion mailing list archive at Nabble.com. > > ===================== > 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 > > > > > ________________________________ > If you reply to this email, your message will be added to the discussion > below: > http://spssx-discussion.1045642.n5.nabble.com/ALTER-TYPE-tp5715594p5716187.html > To unsubscribe from ALTER TYPE, click here. > NAML View this message in context: Re: ALTER TYPE Sent from the SPSSX Discussion mailing list archive at Nabble.com. |
Free forum by Nabble | Edit this page |