Can anyone please tell me why the first syntax does not work and the syntax with date does? How do I fix this?
STRING SEXImp (A7). VAR WIDTH SEXIMP (7). COMPUTE SEXImp=SEX. IF MISSING (SEXImp) SEXImp=SEXX. VARIABLE LABELS SEXImp "Sex of Youth". EXECUTE. NUMERIC DOBImp1 (Date11). VAR WIDTH DOBImp1 (11). COMPUTE DOBImp1=DOBImp. IF MISSING (DOBImp1) DOBImp1=DOBX. VARIABLE LABELS DOBImp1 "Date of Birth". EXECUTE. |
Because SexImp is a string.
1. If you want it to be set to a value of "SEXX", then you need to quote "SEXX". 2. There is no such thing as a system-missing string. So unless you have defined user-missing values (including blank) for SEXImp (which it would appear you have not done), then the condition is never met. Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] Phone: 312.893.4922 | T/L: 206-4922 From: DKUKEC <[hidden email]> To: [hidden email], Date: 08/16/2012 01:17 PM Subject: Replace Missing String Sent by: "SPSSX(r) Discussion" <[hidden email]> Can anyone please tell me why the first syntax does not work and the syntax with date does? How do I fix this? STRING SEXImp (A7). VAR WIDTH SEXIMP (7). COMPUTE SEXImp=SEX. IF MISSING (SEXImp) SEXImp=SEXX. VARIABLE LABELS SEXImp "Sex of Youth". EXECUTE. NUMERIC DOBImp1 (Date11). VAR WIDTH DOBImp1 (11). COMPUTE DOBImp1=DOBImp. IF MISSING (DOBImp1) DOBImp1=DOBX. VARIABLE LABELS DOBImp1 "Date of Birth". EXECUTE. -- View this message in context: http://spssx-discussion.1045642.n5.nabble.com/Replace-Missing-String-tp5714734.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 |
Administrator
|
In reply to this post by DKUKEC
Please define your intentions and provide a definition of doesn't work.
Are Sex, Sexx etc String or Numeric? You Can NOT simply set a string variable to a NUMERIC (See STRING function in the manual). Can't really tell you how to fix it until you tell us how it is broken (hint: error messaqes??). You need to be careful about mixing strings and numerics. NOTE: a BLANK string is NOT a missing value unless you specifically declare it as such.
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?" |
Thank you David, I completed a work around where I recoded the string sex VAR to a numeric. That solved my problem and the syntax worked. I am working with a large clumsy database with multiple
tables. I was trying to clean it up by pulling missing values from one table into a more condensed version; hence, when the sex value was missing in one table I was getting if from another table – or at least the VAR I brought in with the MATCH function. By the way, what is the SYNTAX for declaring a STRING VAR when blank cells should be treated as MISSING? I tried to declare it missing using the VAR editor (NR) however, it
did not work. Cheers, From: David Marso [via SPSSX Discussion] [mailto:ml-node+[hidden email]]
Please define your intentions
and provide a definition of doesn't work. DKUKEC wrote Can anyone please tell me why the first syntax does not work and the syntax with date does? How do I fix this?
If you reply to this email, your message will be added to the discussion below: http://spssx-discussion.1045642.n5.nabble.com/Replace-Missing-String-tp5714734p5714740.html
To unsubscribe from Replace Missing String,
click here. Under Florida law, e-mail addresses are public records. If you do not want your e-mail address released in response to a public records request, do not send electronic mail to this entity. Instead, contact this office by phone or in writing. |
Administrator
|
data list list /var (A3).
begin data. xxx yyy zzz END DATA. FREQ var. MISSING VALUES var (" "). FREQ var. -----
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 DKUKEC
In the Data Editor, in the Missing Values
dialog, enter a single space to identify a blank string as user-missing.
In syntax:
missing values varlist (""). Rick Oliver Senior Information Developer IBM Business Analytics (SPSS) E-mail: [hidden email] Phone: 312.893.4922 | T/L: 206-4922 From: DKUKEC <[hidden email]> To: [hidden email], Date: 08/16/2012 03:39 PM Subject: Re: Replace Missing String Sent by: "SPSSX(r) Discussion" <[hidden email]> Thank you David,
I completed a work around where I recoded the string sex VAR to a numeric. That solved my problem and the syntax worked. I am working with a large clumsy database with multiple tables. I was trying to clean it up by pulling missing values from one table into a more condensed version; hence, when the sex value was missing in one table I was getting if from another table – or at least the VAR I brought in with the MATCH function.
By the way, what is the SYNTAX for declaring a STRING VAR when blank cells should be treated as MISSING? I tried to declare it missing using the VAR editor (NR) however, it did not work.
Cheers,
From: David Marso [via SPSSX Discussion]
[[hidden email][hidden
email]]
Please define your intentions and provide
a definition of doesn't work. DKUKEC wrote Can anyone please tell me why the first syntax does not
work and the syntax with date does? How do I fix this?
If you reply to this email, your message will be added to the discussion below: http://spssx-discussion.1045642.n5.nabble.com/Replace-Missing-String-tp5714734p5714740.html
Under Florida law, e-mail addresses are public records. If you do not want your e-mail address released in response to a public records request, do not send electronic mail to this entity. Instead, contact this office by phone or in writing. View this message in context: RE: Replace Missing String Sent from the SPSSX Discussion mailing list archive at Nabble.com.
|
Hi Rick, Should the SPSS base and Statistics License have CTABLES? Thank you Damir From: Rick Oliver [via SPSSX Discussion] [mailto:[hidden email]] In the Data Editor, in the Missing Values dialog, enter a single space to identify a blank string as user-missing. In syntax:
I completed a work around where I recoded the string sex VAR to a numeric. That solved my problem and the syntax worked. I am working with a large clumsy database with multiple tables. I was trying to clean it up by pulling missing values from one table into a more condensed version; hence, when the sex value was missing in one table I was getting if from another table – or at least the VAR I brought in with the MATCH function. By the way, what is the SYNTAX for declaring a STRING VAR when blank cells should be treated as MISSING? I tried to declare it missing using the VAR editor (NR) however, it did not work. Cheers, From: David Marso [via SPSSX Discussion] [[hidden email][hidden email]] Please define your intentions and provide a definition of doesn't work. DKUKEC wrote Can anyone please tell me why the first syntax does not work and the syntax with date does? How do I fix this? If you reply to this email, your message will be added to the discussion below: http://spssx-discussion.1045642.n5.nabble.com/Replace-Missing-String-tp5714734p5714740.html Under Florida law, e-mail addresses are public records. If you do not want your e-mail address released in response to a public records request, do not send electronic mail to this entity. Instead, contact this office by phone or in writing. View this message in context: RE: Replace Missing String If you reply to this email, your message will be added to the discussion below: http://spssx-discussion.1045642.n5.nabble.com/Replace-Missing-String-tp5714734p5714744.html To unsubscribe from Replace Missing String, click here. |
Hi, CTABLES (and its predecessor TABLES) are optional features, not included in SPSS Base. 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? ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
Free forum by Nabble | Edit this page |