Dear SPSS list,
Can anyone suggest a way to locate a blank cell in a large SPSS file, either by syntax or a menu feature that I'm not aware of? When opening 'find' it does not seem possible unless you want to search for a specific value. Thank you in advance, Gareth ===================== 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 |
Gareth, try something like
Compute location = sysmis(variable). exe. for numeric variables or Compute location = variable = "". exe. for string ones (replace "variable" with the name of the variable of interest). You'll get a new variable named "location"" with ones in the rows where the original variable has blanks. Another possible way is to replace blanks before the search by something else, e.g. RECODE variable (SYSMIS=999) . exe. and then search 999 instead of blanks. Beware, you must be absolutely sure that the variable does not contain 999 as a valid value. The way back is through RECODE variable (999=SYSMIS) . exe. Best regards, Jan -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Gareth Sent: Friday, September 30, 2011 9:31 AM To: [hidden email] Subject: Finding a blank cell Dear SPSS list, Can anyone suggest a way to locate a blank cell in a large SPSS file, either by syntax or a menu feature that I'm not aware of? When opening 'find' it does not seem possible unless you want to search for a specific value. Thank you in advance, Gareth ===================== 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 _____________ Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Jestliže jste tento mail dostali neoprávněně, prosím, uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto přenosem. Jste si jisti, že opravdu potřebujete vytisknout tuto zprávu a/nebo její přílohy? Myslete na přírodu. This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the message as well as all attached documents. The sender does not accept liability for any errors or omissions as a result of the transmission. Are you sure that you really need a print version of this message and/or its attachments? Think about nature. -.- -- ===================== 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 rmjdgeh
Gareth
In the find and replace dialog box click show options and select "Entire Cell". Typing . (a full stop) in the Find box will find system missing numeric variables. Typing one or more spaces in the Find box will find blank (empty) string variables. Garry -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Gareth Sent: 30 September 2011 08:31 To: [hidden email] Subject: Finding a blank cell Dear SPSS list, Can anyone suggest a way to locate a blank cell in a large SPSS file, either by syntax or a menu feature that I'm not aware of? When opening 'find' it does not seem possible unless you want to search for a specific value. Thank you in advance, Gareth ===================== 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 |
Administrator
|
In reply to this post by rmjdgeh
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?" |
Administrator
|
In reply to this post by rmjdgeh
Gareth,
You don't specify whether the variables are numeric or strings. What do you mean by "large"? Is this a single instance among zillions or are they scattered willy nilly? What do you want to do with the "blanks"? At any rate the following will do the trick (you will need to adapt it). If the data are a mix of numeric and string then you will need to move the fields so the numeric are all contiguous and the same with the strings. *SAMPLE DATA* data list /x1 to x10 (10F1.0) s1 to s5 (5A1). begin data 1234 67890ab de 13 2315355ew df 3 1435 653qwsed 24245 4645sasdf 345 264624we tg end data. *USE YOUR OWN DATA!!!*. COMPUTE #ID=$CASENUM. COMPUTE #VARNUM=1. DO REPEAT V=X1 TO X10. + DO IF SYSMIS(V). + PRINT/ #ID #VARNUM. + END IF. + COMPUTE #VARNUM=#VARNUM+1. END REPEAT. COMPUTE #VARNUM=11. DO REPEAT V=S1 TO S5. + DO IF V=" ". + PRINT/ #ID #VARNUM. + END IF. + COMPUTE #VARNUM=#VARNUM+1. END REPEAT. EXE. LIST. X1 X2 X3 X4 X5 X6 X7 X8 X9 X10 S1 S2 S3 S4 S5 1 2 3 4 . 6 7 8 9 0 a b d e 1 3 . 2 3 1 5 3 5 5 e w d f 3 . 1 4 3 5 . 6 5 3 q w s e d 2 4 2 4 5 . 4 6 4 5 s a s d f 3 4 5 . 2 6 4 6 2 4 w e t g Number of cases read: 5 Number of cases listed: 5 *RESULT*. 1.00 5.00 1.00 13.00 2.00 3.00 2.00 13.00 3.00 2.00 3.00 7.00 4.00 6.00 5.00 4.00 5.00 13.00
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?" |
Administrator
|
In reply to this post by Spousta Jan
Jan,
I don't see what this achieves WRT the initial query. David --
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 rmjdgeh
Gareth
I already answered your question once before. See http://listserv.uga.edu/cgi-bin/wa?A2=ind1109&L=spssx-l&P=R54286 Doesn't it work? Garry Gelade -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Gareth Sent: 30 September 2011 08:31 To: [hidden email] Subject: Finding a blank cell Dear SPSS list, Can anyone suggest a way to locate a blank cell in a large SPSS file, either by syntax or a menu feature that I'm not aware of? When opening 'find' it does not seem possible unless you want to search for a specific value. Thank you in advance, Gareth ===================== 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 |
Garry
Yes thank you, it does work. I'm not sure why the original email reached you twice, it appears to be the same one. Best regards, Gareth ________________________________________ From: Garry Gelade [[hidden email]] Sent: 23 November 2011 09:48 To: Hagger-Johnson, Gareth; [hidden email] Subject: RE: Finding a blank cell Gareth I already answered your question once before. See http://listserv.uga.edu/cgi-bin/wa?A2=ind1109&L=spssx-l&P=R54286 Doesn't it work? Garry Gelade -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Gareth Sent: 30 September 2011 08:31 To: [hidden email] Subject: Finding a blank cell Dear SPSS list, Can anyone suggest a way to locate a blank cell in a large SPSS file, either by syntax or a menu feature that I'm not aware of? When opening 'find' it does not seem possible unless you want to search for a specific value. Thank you in advance, Gareth ===================== 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 |
Free forum by Nabble | Edit this page |