How can I save the variable view, not the data, into a file (excel,
spss, text whatever)? I tried 'Save,' but it saves the whole data. Thanks This message is the property of Draft FCB Group and contains information which may be privileged or confidential. It is meant only for the intended recipients and/or their authorized agents. If you believe you have received this message in error, please notify us immediately by return e-mail and destroy any printed or electronic copies of the message. Any unauthorized use, dissemination, disclosure, or copying of this message or the information contained in it, is strictly prohibited and may be unlawful. Thank you for your cooperation. (A) |
Why do you want to do this?
-----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Luo, Peter Sent: Thursday, December 07, 2006 4:17 PM To: [hidden email] Subject: Save Variable View How can I save the variable view, not the data, into a file (excel, spss, text whatever)? I tried 'Save,' but it saves the whole data. Thanks This message is the property of Draft FCB Group and contains information which may be privileged or confidential. It is meant only for the intended recipients and/or their authorized agents. If you believe you have received this message in error, please notify us immediately by return e-mail and destroy any printed or electronic copies of the message. Any unauthorized use, dissemination, disclosure, or copying of this message or the information contained in it, is strictly prohibited and may be unlawful. Thank you for your cooperation. (A) |
I want to create a meta data containing the variable name and the label.
I tried using 'display file info' option but the text output in the output window had all long labels truncated. -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Beadle, ViAnn Sent: Thursday, December 07, 2006 5:47 PM To: [hidden email] Subject: Re: Save Variable View Why do you want to do this? -----Original Message----- From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Luo, Peter Sent: Thursday, December 07, 2006 4:17 PM To: [hidden email] Subject: Save Variable View How can I save the variable view, not the data, into a file (excel, spss, text whatever)? I tried 'Save,' but it saves the whole data. Thanks This message is the property of Draft FCB Group and contains information which may be privileged or confidential. It is meant only for the intended recipients and/or their authorized agents. If you believe you have received this message in error, please notify us immediately by return e-mail and destroy any printed or electronic copies of the message. Any unauthorized use, dissemination, disclosure, or copying of this message or the information contained in it, is strictly prohibited and may be unlawful. Thank you for your cooperation. (A) This message is the property of Draft FCB Group and contains information which may be privileged or confidential. It is meant only for the intended recipients and/or their authorized agents. If you believe you have received this message in error, please notify us immediately by return e-mail and destroy any printed or electronic copies of the message. Any unauthorized use, dissemination, disclosure, or copying of this message or the information contained in it, is strictly prohibited and may be unlawful. Thank you for your cooperation. (A) |
In reply to this post by Luo, Peter
At 05:17 PM 12/7/2006, Luo, Peter wrote:
>How can I save the variable view, not the data, into a file (excel, >spss, text whatever)? I tried 'Save,' but it saves the whole data. Yeah, well, SPSS has been particularly weak about letting you access metadata - the stuff that's in the variable view - as data. You can get at the metadata with Python, and that's the currently recommended way, if you have SPSS 14 or 15. In the meantime, quoting myself, at 12:30 PM 9/6/2006, I wrote ("Data dictionary in SPSS"): >>...if SPSS had something like SAS's PROC CONTENTS, to write a file's >>data dictionary to an SPSS file. > >Here's how to do it using OMS. It writes the dictionary of the working >file. Of course, loading the dictionary overwrites the working file. >(I'm using pre-14 logic. In SPSS 14, if you didn't want to use Python, >you could write the OMS output to a second dataset, and not have to >overwrite the original file.) It's based on the CARS.SAV file that >comes with SPSS, but I added a variable to have one with a long name. > >DISPLAY VARIABLES. > >File Information >|-----------------------------|---------------------------| >|Output Created |06-SEP-2006 13:08:42 | >|-----------------------------|---------------------------| >Variable Information >|-------------|--------|------------|-----------|------|------|-------| >|Variable |Position|Label |Measurement|Print |Write >|Missing| >| | | |Level |Format|Format|Values >| >|-------------|--------|------------|-----------|------|------|-------| >|Variable_with|1 |<none> |Nominal |A8 |A8 | >| >|_long_name | | | | | | >| >|-------------|--------|------------|-----------|------|------|-------| >|mpg |2 |Miles >per |Scale |F4 |F4 | | >| | |Gallon | | | | >| >|-------------|--------|------------|-----------|------|------|-------| >|engine |3 |Engine |Scale |F5 |F5 | >| >| | |Displacement| | | | >| >| | |(cu. >inches)| | | | | >|-------------|--------|------------|-----------|------|------|-------| >|horse |4 |Horsepower |Scale |F5 |F5 | >| >|-------------|--------|------------|-----------|------|------|-------| >|weight |5 |Vehicle |Scale |F4 |F4 | >| >| | |Weight | | | | >| >| | |(lbs.) | | | | >| >|-------------|--------|------------|-----------|------|------|-------| >|accel |6 |Time >to |Scale |F4 |F4 | | >| | |Accelerate | | | | >| >| | |from | | | | >| >| | |0 to 60 mph >| | | | | >| | |(sec) | | | | >| >|-------------|--------|------------|-----------|------|------|-------| >|year |7 |Model >Year |Ordinal |F2 |F2 |0 | >| | |(modulo >100)| | | | | >|-------------|--------|------------|-----------|------|------|-------| >|origin |8 |Country >of |Nominal |F1 |F1 | | >| | |Origin | | | | >| >|-------------|--------|------------|-----------|------|------|-------| >|cylinder |9 |Number >of |Ordinal |F1 |F1 | | >| | |Cylinders | | | | >| >|-------------|--------|------------|-----------|------|------|-------| >|filter_$ |10 |cylrec = >1 |Ordinal |F1 |F1 | | >| | |cylrec = >2 | | | | | >| | |(FILTER) | | | | >| >|-------------|--------|------------|-----------|------|------|-------| >Variables in the working file > >OMS > /SELECT TABLES > /IF COMMANDS=['File Information'] > SUBTYPES=['Variable Information'] > /DESTINATION FORMAT=SAV OUTFILE=ATTRIBS > VIEWER=NO. >. DISPLAY VARIABLES. > > >File Information >|-----------------------------|---------------------------| >|Output Created |06-SEP-2006 13:08:42 | >|-----------------------------|---------------------------| >OMSEND. >GET FILE=ATTRIBS > /DROP=COMMAND_ SUBTYPE_ LABEL_ > /RENAME=(VAR1=NAME). >LIST. > >List >|-----------------------------|---------------------------| >|Output Created |06-SEP-2006 13:08:42 | >|-----------------------------|---------------------------| >The variables are listed in the following order: > >LINE 1: NAME Position > >LINE 2: Label MeasurementLevel PrintFormat WriteFormat MissingValues > > > NAME: Variable_with_long_name 1 > Label: <none> Nominal A8 A8 > > NAME: mpg 2 > Label: Miles per Gallon Scale F4 F4 > > NAME: engine 3 > Label: Engine Displacement (cu. inches) Scale F5 F5 > > NAME: horse 4 > Label: Horsepower Scale F5 F5 > > NAME: weight 5 > Label: Vehicle Weight (lbs.) Scale F4 F4 > > NAME: accel 6 > Label: Time to Accelerate from 0 to 60 mph (sec) Scale F4 F4 > > NAME: year 7 > Label: Model Year (modulo 100) Ordinal F2 F2 > > NAME: origin 8 > Label: Country of Origin Nominal F1 F1 > > NAME: cylinder 9 > Label: Number of Cylinders Ordinal F1 F1 > > NAME: filter_$ 10 > Label: cylrec = 1 | cylrec = 2 (FILTER) Ordinal F1 F1 > >Number of cases read: 10 Number of cases listed: 10 |
Free forum by Nabble | Edit this page |