how to alter type of a variable into "Custom currency"
alter type ... ?
Dr. Frank Gaeth
|
Administrator
|
Please contextualize this?
What do you really need to do? SET CCA="-,$,#,V". DATA LIST FREE / a b. BEGIN DATA 123 666 END DATA. FORMATS a (CCA9.0). ALTER TYPE b (CCA9.0). PRINT /a b. EXECUTE. PRINT /a b. EXECUTE. $123# $666# Personally in my many years of using SPSS I have never found any occasion to use CC formats.
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
In reply to this post by drfg2008
A custom currency is just a format, so
you can simply use the FORMAT command for this. However, ALTER TYPE
can do the same thing:
ALTER TYPE salary (CCA). Of course, CCA or the others must be defined via Edit > Options or via SET. CC's are necessary, for foreign currencies or to control the currency decimal point. However, they do NOT persist with the data. They are part of your preference settings. Therefore, you might want to define them explicitly with syntax in a job that may be run on multiple machines. You can make the definitions persist with the data file if you use DATASET ATTRIBUTES to record the definitions. Then you could convert them to CCs with a dash of Python code. You still have to do this explicitly in the job, but it would allow the definitions to travel with the data. Jon Peck (no "h") aka Kim Senior Software Engineer, IBM [hidden email] phone: 720-342-5621 From: drfg2008 <[hidden email]> To: [hidden email] Date: 01/19/2015 04:07 AM Subject: [SPSSX-L] custom currency Sent by: "SPSSX(r) Discussion" <[hidden email]> how to alter type of a variable into "Custom currency" alter type ... ? ----- Dr. Frank Gaeth -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/custom-currency-tp5728442.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 |
thanks a lot
- I need it for Euro (€ is expected to be attached to the amount)- SET CCA=" ,, €". ALTER TYPE netRevenue hold (CCA9.2). that's perfect
Dr. Frank Gaeth
|
Administrator
|
Frank,
As Jon and I stated you could simply use FORMAT command. ALTER TYPE is useful for coercing strings into numeric or altering widths. --
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me. --- "Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis." Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?" |
Free forum by Nabble | Edit this page |