Replace Missing String

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

Replace Missing String

DKUKEC
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.


Reply | Threaded
Open this post in threaded view
|

Re: Replace Missing String

Rick Oliver-3
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


Reply | Threaded
Open this post in threaded view
|

Re: Replace Missing String

David Marso
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.

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?

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.
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?"
Reply | Threaded
Open this post in threaded view
|

RE: Replace Missing String

DKUKEC

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,
Damir

 

From: David Marso [via SPSSX Discussion] [mailto:ml-node+[hidden email]]
Sent: Thursday, August 16, 2012 3:55 PM
To: Damir Kukec
Subject: Re: Replace Missing String

 

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.

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?

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.

 


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.
NAML



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.
Reply | Threaded
Open this post in threaded view
|

RE: Replace Missing String

David Marso
Administrator
data list list /var (A3).
begin data.
xxx
yyy

zzz
END DATA.
FREQ var.
MISSING VALUES  var (" ").
FREQ var.
-----

DKUKEC wrote
Thank you David,

<SNIP>

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,
Damir

From: David Marso [via SPSSX Discussion] [mailto:[hidden email]]
Sent: Thursday, August 16, 2012 3:55 PM
To: Damir Kukec
Subject: Re: Replace Missing String

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.
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?

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.

________________________________
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<http://spssx-discussion.1045642.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5714734&code=ZGt1a2VjQFBCQ0dPVi5PUkd8NTcxNDczNHwtODUzMTk1MDA0>.
NAML<http://spssx-discussion.1045642.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>

________________________________
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.
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?"
Reply | Threaded
Open this post in threaded view
|

Re: Replace Missing String

Rick Oliver-3
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,
Damir

 

From: David Marso [via SPSSX Discussion] [[hidden email][hidden email]]
Sent:
Thursday, August 16, 2012 3:55 PM
To:
Damir Kukec
Subject:
Re: Replace Missing String

 

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.

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?

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.

 


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.
NAML



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.

Reply | Threaded
Open this post in threaded view
|

RE: Replace Missing String

DKUKEC

Hi Rick,

 

Should the SPSS base and Statistics License have CTABLES?

 

Thank you

Damir

 

From: Rick Oliver [via SPSSX Discussion] [mailto:[hidden email]]
Sent: Thursday, August 16, 2012 4:57 PM
To: Damir Kukec
Subject: Re: Replace Missing String

 

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,
Damir

 

From: David Marso [via SPSSX Discussion] [[hidden email][hidden email]]
Sent:
Thursday, August 16, 2012 3:55 PM
To:
Damir Kukec
Subject:
Re: Replace Missing String

 

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.

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?

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.

 


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.
NAML

 


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.

 


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.
NAML

Reply | Threaded
Open this post in threaded view
|

Re: Replace Missing String

Albert-Jan Roskam
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?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 

From: DKUKEC <[hidden email]>
To: [hidden email]
Sent: Friday, August 17, 2012 8:10 PM
Subject: Re: [SPSSX-L] Replace Missing String

Hi Rick,
 
Should the SPSS base and Statistics License have CTABLES?
 
Thank you
Damir
 
From: Rick Oliver [via SPSSX Discussion] [mailto:[hidden email]]
Sent: Thursday, August 16, 2012 4:57 PM
To: Damir Kukec
Subject: Re: Replace Missing String
 
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,
Damir
 
From: David Marso [via SPSSX Discussion] [[hidden email][hidden email]]
Sent:
Thursday, August 16, 2012 3:55 PM
To:
Damir Kukec
Subject:
Re: Replace Missing String
 
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.
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?

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.
 

If you reply to this email, your message will be added to the discussion below:


View this message in context: RE: Replace Missing String
Sent from the SPSSX Discussion mailing list archive at Nabble.com.