saving from SPSS to ASCII with datamap

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

saving from SPSS to ASCII with datamap

Alex
Hello,

I want to use the WRITE OUTFILE command with the RECORDS subcommand to generate a specific format for my ascii file.This part works great, no problems here.
The issue is if i want to check the ascii file i need a datamap. And the WRITE OUTFILE command combined with the RECORDS subcommand does not generate such a datamap.

Thank you,
Alex
Reply | Threaded
Open this post in threaded view
|

Re: saving from SPSS to ASCII with datamap

Jon K Peck
Add TABLE to your specification, e.g.,
write outfile="c:/temp/write.txt" table/salary jobcat educ gender

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        Alex <[hidden email]>
To:        [hidden email]
Date:        10/01/2012 07:57 AM
Subject:        [SPSSX-L] saving from SPSS to ASCII with datamap
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Hello,

I want to use the WRITE OUTFILE command with the RECORDS subcommand to
generate a specific format for my ascii file.This part works great, no
problems here.
The issue is if i want to check the ascii file i need a datamap. And the
WRITE OUTFILE command combined with the RECORDS subcommand does not generate
such a datamap.

Thank you,
Alex



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/saving-from-SPSS-to-ASCII-with-datamap-tp5715399.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: saving from SPSS to ASCII with datamap

Alex
This is my original syntax:

WRITE OUTFILE='C:\Users\alex\Desktop\ex1.dat'
  Records=1
 /RESPID 1-8
SQ1 10
SQ2 12.
EXECUTE.

now if i add Table / ALL before the Records command i get an error that the RecordS command is not recognized.
if i add Table / ALL after the Records command i get an error that the Table command is not recognized
Reply | Threaded
Open this post in threaded view
|

Re: saving from SPSS to ASCII with datamap

Jon K Peck
WRITE OUTFILE='C:\Users\alex\Desktop\ex1.dat'
 Records=1 table
/RESPID 1-8
SQ1 10
SQ2 12.


You don't actually need the records specification anyway.  It doesn't affect the operation of the command.

Jon Peck (no "h") aka Kim
Senior Software Engineer, IBM
[hidden email]
new phone: 720-342-5621




From:        Alex <[hidden email]>
To:        [hidden email]
Date:        10/01/2012 09:09 AM
Subject:        Re: [SPSSX-L] saving from SPSS to ASCII with datamap
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




This is my original syntax:

WRITE OUTFILE='C:\Users\alex\Desktop\ex1.dat'
 Records=1
/RESPID 1-8
SQ1 10
SQ2 12.
EXECUTE.

now if i add Table / ALL before the Records command i get an error that the
RecordS command is not recognized.
if i add Table / ALL after the Records command i get an error that the Table
command is not recognized



--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/saving-from-SPSS-to-ASCII-with-datamap-tp5715399p5715404.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: saving from SPSS to ASCII with datamap

David Marso
Administrator
In reply to this post by Alex

GET FILE='C:\Program Files\SPSS\1991 U.S. General Social Survey.sav'.

WRITE OUTFILE "C:\temp\write test.dat"  RECORDS 3 TABLE
 / 1 sex race region happy (4(F8.2,x))
 / 2 life sibs childs (3(F10.6,x))
 / 3 age (F20.16).
EXE.
---------

Write will generate the following

Variable   Rec   Start     End         Format

SEX          1       1       8         F8.2
RACE         1      10      17         F8.2
REGION       1      19      26         F8.2
HAPPY        1      28      35         F8.2
LIFE         2       1      10         F10.6
SIBS         2      12      21         F10.6
CHILDS       2      23      32         F10.6
AGE          3       1      20         F20.16


Alex wrote
This is my original syntax:

WRITE OUTFILE='C:\Users\alex\Desktop\ex1.dat'
  Records=1
 /RESPID 1-8
SQ1 10
SQ2 12.
EXECUTE.

now if i add Table / ALL before the Records command i get an error that the RecordS command is not recognized.
if i add Table / ALL after the Records command i get an error that the Table command is not recognized
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: saving from SPSS to ASCII with datamap

Alex
Like a charm :D thanks a lot!