Exporting Data Problem

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

Exporting Data Problem

Morrell, Ronald

I work in a Florida state agency and recently received an assignment to develop a process to send data to another state agency.  The process will become a weekly data exchange.  The office uses SPSS for many of its data functions, including exporting data.  I’ve developed syntax to capture the data needed and export it using the WRITE command.  The syntax is working, but when I FTP the file to the other agency, they see the following junk characters, , at the beginning of the data file.  This causes the file to reject before processing.  I’ve used several programs to look at the file before transmitting, and I cannot see the junk character.  Is SPSS inserting the junk characters or do I need to consider another possible cause?

 

My purpose asking the question to the forum is to eliminate SPSS as a possible cause of the junk characters.

 

WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'

   /SSN (A9)

    DJJ317 (A6)

    LASTNAME (A20)

    FRSTNAME (A11)

    MI (A15)

    achaDOB (A8)

    SEX (a1)

    ReportTy (A1)

    ReportDte (A8)

    RprtPd1 (A8)

    RprtPd2 (A8)

    ConvDte (A8)

    achaadmtdte (A8)

    Filler (A33)

    acharlsdte (A8).

EXECUTE   .

 

Thank you in advance for any assistance that can be provided.

 

 

Have a Great Day!

 

Ronald A. Morrell

GOCII, Office of Research and Planning

PH: (850) 717-2637

 

If life were any better, I’d be a twin.

 

You know what, I AM!

 

Learn more about DJJ’s Roadmap to System Excellence at http://www.djj.state.fl.us/roadmap-to-system-excellence

 

 

 

 

Reply | Threaded
Open this post in threaded view
|

Re: Exporting Data Problem

Jon K Peck
This is not a junk character.  Text files written in the Unicode encoding have this three-byte prefix, called a BOM (byte order mark) that identifies it as encoded in utf-8.  You don't see this in, say, Notepad, because Notepad correctly recognizes and removes the BOM and interprets the file as utf-8.

The WRITE command in V22 has a keyword BOM=YES or NO.  In V21 you can specify the encoding as ENCODING=LOCALE to write the file in code page mode.  That will eliminate the BOM, but any characters outside the western European code page will be lost.


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




From:        "Morrell, Ronald" <[hidden email]>
To:        [hidden email],
Date:        05/14/2014 01:14 PM
Subject:        [SPSSX-L] Exporting Data Problem
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




I work in a Florida state agency and recently received an assignment to develop a process to send data to another state agency.  The process will become a weekly data exchange.  The office uses SPSS for many of its data functions, including exporting data.  I’ve developed syntax to capture the data needed and export it using the WRITE command.  The syntax is working, but when I FTP the file to the other agency, they see the following junk characters, , at the beginning of the data file.  This causes the file to reject before processing.  I’ve used several programs to look at the file before transmitting, and I cannot see the junk character.  Is SPSS inserting the junk characters or do I need to consider another possible cause?
 
My purpose asking the question to the forum is to eliminate SPSS as a possible cause of the junk characters.
 
WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'
   /SSN (A9)
    DJJ317 (A6)
    LASTNAME (A20)
    FRSTNAME (A11)
    MI (A15)
    achaDOB (A8)
    SEX (a1)
    ReportTy (A1)
    ReportDte (A8)
    RprtPd1 (A8)
    RprtPd2 (A8)
    ConvDte (A8)
    achaadmtdte (A8)
    Filler (A33)
    acharlsdte (A8).
EXECUTE   .
 
Thank you in advance for any assistance that can be provided.
 
 
Have a Great Day!
 
Ronald A. Morrell
GOCII, Office of Research and Planning
PH: (850) 717-2637
 
If life were any better, I’d be a twin.
 
You know what, I AM!
 
Learn more about DJJ’s Roadmap to System Excellence at http://www.djj.state.fl.us/roadmap-to-system-excellence
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Exporting Data Problem

Rick Oliver-3
In reply to this post by Morrell, Ronald
The "junk characters" are the UTF8 byte order mark. In Unicode mode, WRITE will export in UTF8 format by default. If the application that reads the file requires a code page encoding, add ENCODING='Locale" to the WRITE command.

Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]




From:        "Morrell, Ronald" <[hidden email]>
To:        [hidden email],
Date:        05/14/2014 02:18 PM
Subject:        Exporting Data Problem
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




I work in a Florida state agency and recently received an assignment to develop a process to send data to another state agency.  The process will become a weekly data exchange.  The office uses SPSS for many of its data functions, including exporting data.  I’ve developed syntax to capture the data needed and export it using the WRITE command.  The syntax is working, but when I FTP the file to the other agency, they see the following junk characters, , at the beginning of the data file.  This causes the file to reject before processing.  I’ve used several programs to look at the file before transmitting, and I cannot see the junk character.  Is SPSS inserting the junk characters or do I need to consider another possible cause?
 
My purpose asking the question to the forum is to eliminate SPSS as a possible cause of the junk characters.
 
WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'
   /SSN (A9)
    DJJ317 (A6)
    LASTNAME (A20)
    FRSTNAME (A11)
    MI (A15)
    achaDOB (A8)
    SEX (a1)
    ReportTy (A1)
    ReportDte (A8)
    RprtPd1 (A8)
    RprtPd2 (A8)
    ConvDte (A8)
    achaadmtdte (A8)
    Filler (A33)
    acharlsdte (A8).
EXECUTE   .
 
Thank you in advance for any assistance that can be provided.
 
 
Have a Great Day!
 
Ronald A. Morrell
GOCII, Office of Research and Planning
PH: (850) 717-2637
 
If life were any better, I’d be a twin.
 
You know what, I AM!
 
Learn more about DJJ’s Roadmap to System Excellence at http://www.djj.state.fl.us/roadmap-to-system-excellence
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Exporting Data Problem

Rick Oliver-3
In reply to this post by Morrell, Ronald
Addendum:
You won't see the byte order mark in any application that can correctly read a UTF8 file.

Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]




From:        Rick Oliver/Chicago/IBM
To:        "Morrell, Ronald" <[hidden email]>,
Cc:        [hidden email]
Date:        05/14/2014 02:32 PM
Subject:        Re: Exporting Data Problem



The "junk characters" are the UTF8 byte order mark. In Unicode mode, WRITE will export in UTF8 format by default. If the application that reads the file requires a code page encoding, add ENCODING='Locale" to the WRITE command.

Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]





From:        "Morrell, Ronald" <[hidden email]>
To:        [hidden email],
Date:        05/14/2014 02:18 PM
Subject:        Exporting Data Problem
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




I work in a Florida state agency and recently received an assignment to develop a process to send data to another state agency.  The process will become a weekly data exchange.  The office uses SPSS for many of its data functions, including exporting data.  I’ve developed syntax to capture the data needed and export it using the WRITE command.  The syntax is working, but when I FTP the file to the other agency, they see the following junk characters, , at the beginning of the data file.  This causes the file to reject before processing.  I’ve used several programs to look at the file before transmitting, and I cannot see the junk character.  Is SPSS inserting the junk characters or do I need to consider another possible cause?
 
My purpose asking the question to the forum is to eliminate SPSS as a possible cause of the junk characters.
 
WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'
   /SSN (A9)
    DJJ317 (A6)
    LASTNAME (A20)
    FRSTNAME (A11)
    MI (A15)
    achaDOB (A8)
    SEX (a1)
    ReportTy (A1)
    ReportDte (A8)
    RprtPd1 (A8)
    RprtPd2 (A8)
    ConvDte (A8)
    achaadmtdte (A8)
    Filler (A33)
    acharlsdte (A8).
EXECUTE   .
 
Thank you in advance for any assistance that can be provided.
 
 
Have a Great Day!
 
Ronald A. Morrell
GOCII, Office of Research and Planning
PH: (850) 717-2637
 
If life were any better, I’d be a twin.
 
You know what, I AM!
 
Learn more about DJJ’s Roadmap to System Excellence at http://www.djj.state.fl.us/roadmap-to-system-excellence
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Exporting Data Problem

Rick Oliver-3
In reply to this post by Jon K Peck
The only catch with BOM=NO, is that it's still a UTF8 file; so if the application consuming the data can't read a UTF8 file...

Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]




From:        Jon K Peck/Chicago/IBM@IBMUS
To:        [hidden email],
Date:        05/14/2014 02:37 PM
Subject:        Re: Exporting Data Problem
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




This is not a junk character.  Text files written in the Unicode encoding have this three-byte prefix, called a BOM (byte order mark) that identifies it as encoded in utf-8.  You don't see this in, say, Notepad, because Notepad correctly recognizes and removes the BOM and interprets the file as utf-8.

The WRITE command in V22 has a keyword BOM=YES or NO.  In V21 you can specify the encoding as ENCODING=LOCALE to write the file in code page mode.  That will eliminate the BOM, but any characters outside the western European code page will be lost.



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





From:        
"Morrell, Ronald" <[hidden email]>
To:        
[hidden email],
Date:        
05/14/2014 01:14 PM
Subject:        
[SPSSX-L] Exporting Data Problem
Sent by:        
"SPSSX(r) Discussion" <[hidden email]>




I work in a Florida state agency and recently received an assignment to develop a process to send data to another state agency.  The process will become a weekly data exchange.  The office uses SPSS for many of its data functions, including exporting data.  I’ve developed syntax to capture the data needed and export it using the WRITE command.  The syntax is working, but when I FTP the file to the other agency, they see the following junk characters, , at the beginning of the data file.  This causes the file to reject before processing.  I’ve used several programs to look at the file before transmitting, and I cannot see the junk character.  Is SPSS inserting the junk characters or do I need to consider another possible cause?
 
My purpose asking the question to the forum is to eliminate SPSS as a possible cause of the junk characters.

 
WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'

  /SSN (A9)

   DJJ317 (A6)

   LASTNAME (A20)
   FRSTNAME (A11)
   MI (A15)
   achaDOB (A8)
   SEX (a1)
   ReportTy (A1)
   ReportDte (A8)
   RprtPd1 (A8)
   RprtPd2 (A8)

   ConvDte (A8)

   achaadmtdte (A8)

   Filler (A33)

   acharlsdte (A8).

EXECUTE   .

 
Thank you in advance for any assistance that can be provided.

 
 
Have a Great Day!

 
Ronald A. Morrell

GOCII, Office of Research and Planning

PH: (850) 717-2637

 
If life were any better, I’d be a twin.

 
You know what, I AM!

 
Learn more about DJJ’s Roadmap to System Excellence at
http://www.djj.state.fl.us/roadmap-to-system-excellence
 
 
 
 
Reply | Threaded
Open this post in threaded view
|

Re: Exporting Data Problem

Bruce Weaver
Administrator
In reply to this post by Morrell, Ronald
Ronald, I'm curious about why you're using WRITE rather than SAVE TRANSLATE.  E.g., why not something like this?

SAVE TRANSLATE OUTFILE = !PATH2+ 'djj_20140501095500.dat'
  /TYPE=TAB
  /ENCODING='Locale'
  /MAP
  /REPLACE
  /FIELDNAMES
  /CELLS=VALUES
  /KEEP= SSN DJJ317 LASTNAME FRSTNAME MI achaDOB SEX ReportTy
         ReportDte RprtPd1 RprtPd2 ConvDte achaadmtdte Filler acharlsdte
.


If you are writing all the variables in the working file, you could omit the /KEEP sub-command; or if the variables are contiguous, you could use the "FirstVar TO LastVar shortcut".  I assume the /ENCODING = 'Locale' sub-command here will address the problem, given what Jon and Rick have posted about that being a solution for WRITE.  

Cheers,
Bruce



Morrell, Ronald wrote
I work in a Florida state agency and recently received an assignment to develop a process to send data to another state agency.  The process will become a weekly data exchange.  The office uses SPSS for many of its data functions, including exporting data.  I've developed syntax to capture the data needed and export it using the WRITE command.  The syntax is working, but when I FTP the file to the other agency, they see the following junk characters, , at the beginning of the data file.  This causes the file to reject before processing.  I've used several programs to look at the file before transmitting, and I cannot see the junk character.  Is SPSS inserting the junk characters or do I need to consider another possible cause?

My purpose asking the question to the forum is to eliminate SPSS as a possible cause of the junk characters.

WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'
   /SSN (A9)
    DJJ317 (A6)
    LASTNAME (A20)
    FRSTNAME (A11)
    MI (A15)
    achaDOB (A8)
    SEX (a1)
    ReportTy (A1)
    ReportDte (A8)
    RprtPd1 (A8)
    RprtPd2 (A8)
    ConvDte (A8)
    achaadmtdte (A8)
    Filler (A33)
    acharlsdte (A8).
EXECUTE   .

Thank you in advance for any assistance that can be provided.


Have a Great Day!

Ronald A. Morrell
GOCII, Office of Research and Planning
PH: (850) 717-2637

If life were any better, I'd be a twin.

You know what, I AM!

Learn more about DJJ's Roadmap to System Excellence at http://www.djj.state.fl.us/roadmap-to-system-excellence
--
Bruce Weaver
bweaver@lakeheadu.ca
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

PLEASE NOTE THE FOLLOWING: 
1. My Hotmail account is not monitored regularly. To send me an e-mail, please use the address shown above.
2. The SPSSX Discussion forum on Nabble is no longer linked to the SPSSX-L listserv administered by UGA (https://listserv.uga.edu/).
Reply | Threaded
Open this post in threaded view
|

Re: Exporting Data Problem

Rick Oliver-3
The choice of SAVE TRANSLATE or WRITE depends on the application that will read the end result.

If it can read CSV or tab-delimited files, then you would used SAVE TRANSLATE.

If it requires fixed format data, with each variable in a specific column location, then you would use WRITE.

Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]




From:        Bruce Weaver <[hidden email]>
To:        [hidden email],
Date:        05/14/2014 02:55 PM
Subject:        Re: Exporting Data Problem
Sent by:        "SPSSX(r) Discussion" <[hidden email]>




Ronald, I'm curious about why you're using WRITE rather than SAVE TRANSLATE.
E.g., why not something like this?

SAVE TRANSLATE OUTFILE = !PATH2+ 'djj_20140501095500.dat'
 /TYPE=TAB
 /ENCODING='Locale'
 /MAP
 /REPLACE
 /FIELDNAMES
 /CELLS=VALUES
 /KEEP= SSN DJJ317 LASTNAME FRSTNAME MI achaDOB SEX ReportTy
        ReportDte RprtPd1 RprtPd2 ConvDte achaadmtdte Filler acharlsdte
.


If you are writing all the variables in the working file, you could omit the
/KEEP sub-command; or if the variables are contiguous, you could use the
"FirstVar TO LastVar shortcut".  I assume the /ENCODING = 'Locale'
sub-command here will address the problem, given what Jon and Rick have
posted about that being a solution for WRITE.

Cheers,
Bruce




Morrell, Ronald wrote
> I work in a Florida state agency and recently received an assignment to
> develop a process to send data to another state agency.  The process will
> become a weekly data exchange.  The office uses SPSS for many of its data
> functions, including exporting data.  I've developed syntax to capture the
> data needed and export it using the WRITE command.  The syntax is working,
> but when I FTP the file to the other agency, they see the following junk
> characters, , at the beginning of the data file.  This causes the file
> to reject before processing.  I've used several programs to look at the
> file before transmitting, and I cannot see the junk character.  Is SPSS
> inserting the junk characters or do I need to consider another possible
> cause?
>
> My purpose asking the question to the forum is to eliminate SPSS as a
> possible cause of the junk characters.
>
> WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'
>    /SSN (A9)
>     DJJ317 (A6)
>     LASTNAME (A20)
>     FRSTNAME (A11)
>     MI (A15)
>     achaDOB (A8)
>     SEX (a1)
>     ReportTy (A1)
>     ReportDte (A8)
>     RprtPd1 (A8)
>     RprtPd2 (A8)
>     ConvDte (A8)
>     achaadmtdte (A8)
>     Filler (A33)
>     acharlsdte (A8).
> EXECUTE   .
>
> Thank you in advance for any assistance that can be provided.
>
>
> Have a Great Day!
>
> Ronald A. Morrell
> GOCII, Office of Research and Planning
> PH: (850) 717-2637
>
> If life were any better, I'd be a twin.
>
> You know what, I AM!
>
> Learn more about DJJ's Roadmap to System Excellence at
>
http://www.djj.state.fl.us/roadmap-to-system-excellence





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Exporting-Data-Problem-tp5726036p5726041.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: Exporting Data Problem

Albert-Jan Roskam
In reply to this post by Rick Oliver-3
________________________________
> From: Rick Oliver <[hidden email]>
>To: [hidden email]
>Sent: Wednesday, May 14, 2014 9:44 PM
>Subject: Re: [SPSSX-L] Exporting Data Problem
>
>
>
>The only catch with BOM=NO, is that it's still a UTF8 file; so if the application consuming the data >can't read a UTF8 file...


...then this system should be deleted, shredded, pulverized. ;-)

=====================
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: Exporting Data Problem

Morrell, Ronald
In reply to this post by Rick Oliver-3

I went with the WRITE command because the final file needs to be fixed width, and I did not want to include intermediate steps in the process.

 

I like to follow KISS when possible.

 

Ron

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Rick Oliver
Sent: Wednesday, May 14, 2014 4:00 PM
To: [hidden email]
Subject: Re: Exporting Data Problem

 

The choice of SAVE TRANSLATE or WRITE depends on the application that will read the end result.

If it can read CSV or tab-delimited files, then you would used SAVE TRANSLATE.

If it requires fixed format data, with each variable in a specific column location, then you would use WRITE.

Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]




From:        Bruce Weaver <[hidden email]>
To:        [hidden email],
Date:        05/14/2014 02:55 PM
Subject:        Re: Exporting Data Problem
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Ronald, I'm curious about why you're using WRITE rather than SAVE TRANSLATE.
E.g., why not something like this?

SAVE TRANSLATE OUTFILE = !PATH2+ 'djj_20140501095500.dat'
 /TYPE=TAB
 /ENCODING='Locale'
 /MAP
 /REPLACE
 /FIELDNAMES
 /CELLS=VALUES
 /KEEP= SSN DJJ317 LASTNAME FRSTNAME MI achaDOB SEX ReportTy
        ReportDte RprtPd1 RprtPd2 ConvDte achaadmtdte Filler acharlsdte
.


If you are writing all the variables in the working file, you could omit the
/KEEP sub-command; or if the variables are contiguous, you could use the
"FirstVar TO LastVar shortcut".  I assume the /ENCODING = 'Locale'
sub-command here will address the problem, given what Jon and Rick have
posted about that being a solution for WRITE.

Cheers,
Bruce




Morrell, Ronald wrote
> I work in a Florida state agency and recently received an assignment to
> develop a process to send data to another state agency.  The process will
> become a weekly data exchange.  The office uses SPSS for many of its data
> functions, including exporting data.  I've developed syntax to capture the
> data needed and export it using the WRITE command.  The syntax is working,
> but when I FTP the file to the other agency, they see the following junk
> characters, , at the beginning of the data file.  This causes the file
> to reject before processing.  I've used several programs to look at the
> file before transmitting, and I cannot see the junk character.  Is SPSS
> inserting the junk characters or do I need to consider another possible
> cause?
>
> My purpose asking the question to the forum is to eliminate SPSS as a
> possible cause of the junk characters.
>
> WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'
>    /SSN (A9)
>     DJJ317 (A6)
>     LASTNAME (A20)
>     FRSTNAME (A11)
>     MI (A15)
>     achaDOB (A8)
>     SEX (a1)
>     ReportTy (A1)
>     ReportDte (A8)
>     RprtPd1 (A8)
>     RprtPd2 (A8)
>     ConvDte (A8)
>     achaadmtdte (A8)
>     Filler (A33)
>     acharlsdte (A8).
> EXECUTE   .
>
> Thank you in advance for any assistance that can be provided.
>
>
> Have a Great Day!
>
> Ronald A. Morrell
> GOCII, Office of Research and Planning
> PH: (850) 717-2637
>
> If life were any better, I'd be a twin.
>
> You know what, I AM!
>
> Learn more about DJJ's Roadmap to System Excellence at
>
http://www.djj.state.fl.us/roadmap-to-system-excellence





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Exporting-Data-Problem-tp5726036p5726041.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: Exporting Data Problem

Art Kendall
In reply to this post by Morrell, Ronald
What is the software the recipients will use?
Art Kendall
Social Research Consultants
On 5/14/2014 3:20 PM, Morrell, Ronald [via SPSSX Discussion] wrote:

I work in a Florida state agency and recently received an assignment to develop a process to send data to another state agency.  The process will become a weekly data exchange.  The office uses SPSS for many of its data functions, including exporting data.  I’ve developed syntax to capture the data needed and export it using the WRITE command.  The syntax is working, but when I FTP the file to the other agency, they see the following junk characters, , at the beginning of the data file.  This causes the file to reject before processing.  I’ve used several programs to look at the file before transmitting, and I cannot see the junk character.  Is SPSS inserting the junk characters or do I need to consider another possible cause?

 

My purpose asking the question to the forum is to eliminate SPSS as a possible cause of the junk characters.

 

WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'

   /SSN (A9)

    DJJ317 (A6)

    LASTNAME (A20)

    FRSTNAME (A11)

    MI (A15)

    achaDOB (A8)

    SEX (a1)

    ReportTy (A1)

    ReportDte (A8)

    RprtPd1 (A8)

    RprtPd2 (A8)

    ConvDte (A8)

    achaadmtdte (A8)

    Filler (A33)

    acharlsdte (A8).

EXECUTE   .

 

Thank you in advance for any assistance that can be provided.

 

 

Have a Great Day!

 

Ronald A. Morrell

GOCII, Office of Research and Planning

PH: (850) 717-2637

 

If life were any better, I’d be a twin.

 

You know what, I AM!

 

Learn more about DJJ’s Roadmap to System Excellence at http://www.djj.state.fl.us/roadmap-to-system-excellence

 

 

 

 




If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/Exporting-Data-Problem-tp5726036.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Exporting Data Problem

Art Kendall
In reply to this post by Morrell, Ronald
do you mean that there is a limit on record length or that each field has to have a specified width,i.e., fixed width fields such SPSS would read as DATA LIST FIXED...?


Art Kendall
Social Research Consultants
On 5/14/2014 4:14 PM, Morrell, Ronald [via SPSSX Discussion] wrote:

I went with the WRITE command because the final file needs to be fixed width, and I did not want to include intermediate steps in the process.

 

I like to follow KISS when possible.

 

Ron

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Rick Oliver
Sent: Wednesday, May 14, 2014 4:00 PM
To: [hidden email]
Subject: Re: Exporting Data Problem

 

The choice of SAVE TRANSLATE or WRITE depends on the application that will read the end result.

If it can read CSV or tab-delimited files, then you would used SAVE TRANSLATE.

If it requires fixed format data, with each variable in a specific column location, then you would use WRITE.

Rick Oliver
Senior Information Developer
IBM Business Analytics (SPSS)
E-mail: [hidden email]




From:        Bruce Weaver <[hidden email]>
To:        [hidden email],
Date:        05/14/2014 02:55 PM
Subject:        Re: Exporting Data Problem
Sent by:        "SPSSX(r) Discussion" <[hidden email]>





Ronald, I'm curious about why you're using WRITE rather than SAVE TRANSLATE.
E.g., why not something like this?

SAVE TRANSLATE OUTFILE = !PATH2+ 'djj_20140501095500.dat'
 /TYPE=TAB
 /ENCODING='Locale'
 /MAP
 /REPLACE
 /FIELDNAMES
 /CELLS=VALUES
 /KEEP= SSN DJJ317 LASTNAME FRSTNAME MI achaDOB SEX ReportTy
        ReportDte RprtPd1 RprtPd2 ConvDte achaadmtdte Filler acharlsdte
.


If you are writing all the variables in the working file, you could omit the
/KEEP sub-command; or if the variables are contiguous, you could use the
"FirstVar TO LastVar shortcut".  I assume the /ENCODING = 'Locale'
sub-command here will address the problem, given what Jon and Rick have
posted about that being a solution for WRITE.

Cheers,
Bruce




Morrell, Ronald wrote
> I work in a Florida state agency and recently received an assignment to
> develop a process to send data to another state agency.  The process will
> become a weekly data exchange.  The office uses SPSS for many of its data
> functions, including exporting data.  I've developed syntax to capture the
> data needed and export it using the WRITE command.  The syntax is working,
> but when I FTP the file to the other agency, they see the following junk
> characters, , at the beginning of the data file.  This causes the file
> to reject before processing.  I've used several programs to look at the
> file before transmitting, and I cannot see the junk character.  Is SPSS
> inserting the junk characters or do I need to consider another possible
> cause?
>
> My purpose asking the question to the forum is to eliminate SPSS as a
> possible cause of the junk characters.
>
> WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'
>    /SSN (A9)
>     DJJ317 (A6)
>     LASTNAME (A20)
>     FRSTNAME (A11)
>     MI (A15)
>     achaDOB (A8)
>     SEX (a1)
>     ReportTy (A1)
>     ReportDte (A8)
>     RprtPd1 (A8)
>     RprtPd2 (A8)
>     ConvDte (A8)
>     achaadmtdte (A8)
>     Filler (A33)
>     acharlsdte (A8).
> EXECUTE   .
>
> Thank you in advance for any assistance that can be provided.
>
>
> Have a Great Day!
>
> Ronald A. Morrell
> GOCII, Office of Research and Planning
> PH: (850) 717-2637
>
> If life were any better, I'd be a twin.
>
> You know what, I AM!
>
> Learn more about DJJ's Roadmap to System Excellence at
>
http://www.djj.state.fl.us/roadmap-to-system-excellence





-----
--
Bruce Weaver
[hidden email]
http://sites.google.com/a/lakeheadu.ca/bweaver/

"When all else fails, RTFM."

NOTE: My Hotmail account is not monitored regularly.
To send me an e-mail, please use the address shown above.

--
View this message in context:
http://spssx-discussion.1045642.n5.nabble.com/Exporting-Data-Problem-tp5726036p5726041.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




If you reply to this email, your message will be added to the discussion below:
http://spssx-discussion.1045642.n5.nabble.com/Exporting-Data-Problem-tp5726036p5726044.html
To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Exporting Data Problem

Morrell, Ronald
In reply to this post by Art Kendall

They are going to read the file into a mainframe UNIX system.

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Art Kendall
Sent: Wednesday, May 14, 2014 4:25 PM
To: [hidden email]
Subject: Re: Exporting Data Problem

 

What is the software the recipients will use?

Art Kendall
Social Research Consultants

On 5/14/2014 3:20 PM, Morrell, Ronald [via SPSSX Discussion] wrote:

I work in a Florida state agency and recently received an assignment to develop a process to send data to another state agency.  The process will become a weekly data exchange.  The office uses SPSS for many of its data functions, including exporting data.  I’ve developed syntax to capture the data needed and export it using the WRITE command.  The syntax is working, but when I FTP the file to the other agency, they see the following junk characters, , at the beginning of the data file.  This causes the file to reject before processing.  I’ve used several programs to look at the file before transmitting, and I cannot see the junk character.  Is SPSS inserting the junk characters or do I need to consider another possible cause?

 

My purpose asking the question to the forum is to eliminate SPSS as a possible cause of the junk characters.

 

WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'

   /SSN (A9)

    DJJ317 (A6)

    LASTNAME (A20)

    FRSTNAME (A11)

    MI (A15)

    achaDOB (A8)

    SEX (a1)

    ReportTy (A1)

    ReportDte (A8)

    RprtPd1 (A8)

    RprtPd2 (A8)

    ConvDte (A8)

    achaadmtdte (A8)

    Filler (A33)

    acharlsdte (A8).

EXECUTE   .

 

Thank you in advance for any assistance that can be provided.

 

 

Have a Great Day!

 

Ronald A. Morrell

GOCII, Office of Research and Planning

PH: (850) 717-2637

 

If life were any better, I’d be a twin.

 

You know what, I AM!

 

Learn more about DJJ’s Roadmap to System Excellence at http://www.djj.state.fl.us/roadmap-to-system-excellence

 

 

 

 

 


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

http://spssx-discussion.1045642.n5.nabble.com/Exporting-Data-Problem-tp5726036.html

To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

 

Art Kendall
Social Research Consultants

 


View this message in context: Re: Exporting Data Problem
Sent from the SPSSX Discussion mailing list archive at Nabble.com.

Reply | Threaded
Open this post in threaded view
|

Re: Exporting Data Problem

Art Kendall
In reply to this post by Morrell, Ronald
What software are they using on the server?
Art Kendall
Social Research Consultants
On 5/14/2014 4:51 PM, Morrell, Ronald wrote:

They are going to read the file into a mainframe UNIX system.

 

From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Art Kendall
Sent: Wednesday, May 14, 2014 4:25 PM
To: [hidden email]
Subject: Re: Exporting Data Problem

 

What is the software the recipients will use?

Art Kendall
Social Research Consultants

On 5/14/2014 3:20 PM, Morrell, Ronald [via SPSSX Discussion] wrote:

I work in a Florida state agency and recently received an assignment to develop a process to send data to another state agency.  The process will become a weekly data exchange.  The office uses SPSS for many of its data functions, including exporting data.  I’ve developed syntax to capture the data needed and export it using the WRITE command.  The syntax is working, but when I FTP the file to the other agency, they see the following junk characters, , at the beginning of the data file.  This causes the file to reject before processing.  I’ve used several programs to look at the file before transmitting, and I cannot see the junk character.  Is SPSS inserting the junk characters or do I need to consider another possible cause?

 

My purpose asking the question to the forum is to eliminate SPSS as a possible cause of the junk characters.

 

WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'

   /SSN (A9)

    DJJ317 (A6)

    LASTNAME (A20)

    FRSTNAME (A11)

    MI (A15)

    achaDOB (A8)

    SEX (a1)

    ReportTy (A1)

    ReportDte (A8)

    RprtPd1 (A8)

    RprtPd2 (A8)

    ConvDte (A8)

    achaadmtdte (A8)

    Filler (A33)

    acharlsdte (A8).

EXECUTE   .

 

Thank you in advance for any assistance that can be provided.

 

 

Have a Great Day!

 

Ronald A. Morrell

GOCII, Office of Research and Planning

PH: (850) 717-2637

 

If life were any better, I’d be a twin.

 

You know what, I AM!

 

Learn more about DJJ’s Roadmap to System Excellence at http://www.djj.state.fl.us/roadmap-to-system-excellence

 

 

 

 

 


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

http://spssx-discussion.1045642.n5.nabble.com/Exporting-Data-Problem-tp5726036.html

To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

 

Art Kendall
Social Research Consultants

 


View this message in context: Re: Exporting Data Problem
Sent from the SPSSX Discussion mailing list archive at Nabble.com.


Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Exporting Data Problem

Art Kendall
In reply to this post by Morrell, Ronald
What software are they running on the server?

Art Kendall
Social Research Consultants
On 5/14/2014 4:51 PM, Morrell, Ronald wrote:

They are going to read the file into a mainframe UNIX system.

From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Art Kendall
Sent: Wednesday, May 14, 2014 4:25 PM
To: [hidden email]
Subject: Re: Exporting Data Problem

What is the software the recipients will use?

Art Kendall
Social Research Consultants

On 5/14/2014 3:20 PM, Morrell, Ronald [via SPSSX Discussion] wrote:

I work in a Florida state agency and recently received an assignment to develop a process to send data to another state agency.� The process will become a weekly data exchange.� The office uses SPSS for many of its data functions, including exporting data.� I’ve developed syntax to capture the data needed and export it using the WRITE command.� The syntax is working, but when I FTP the file to the other agency, they see the following junk characters, , at the beginning of the data file.� This causes the file to reject before processing.� I’ve used several programs to look at the file before transmitting, and I cannot see the junk character.� Is SPSS inserting the junk characters or do I need to consider another possible cause?

My purpose asking the question to the forum is to eliminate SPSS as a possible cause of the junk characters.

WRITE� � OUTFILE� � = !PATH2+ 'djj_20140501095500.dat'

� � /SSN (A9)

� � � DJJ317 (A6)

� � � LASTNAME (A20)

� � � � FRSTNAME (A11)

� � � � MI (A15)

� � � � achaDOB (A8)

� � � � SEX (a1)

� � � � ReportTy (A1)

� � � � ReportDte (A8)

� � � � RprtPd1 (A8)

� � � � RprtPd2 (A8)

� � � ConvDte (A8)

� � � achaadmtdte (A8)

� � � Filler (A33)

� � � acharlsdte (A8).

EXECUTE� � .

Thank you in advance for any assistance that can be provided.

Have a Great Day!

Ronald A. Morrell

GOCII, Office of Research and Planning

PH: (850) 717-2637

If life were any better, I’d be a twin.

You know what, I AM!

Learn more about DJJ’s Roadmap to System Excellence at http://www.djj.state.fl.us/roadmap-to-system-excellence


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

http://spssx-discussion.1045642.n5.nabble.com/Exporting-Data-Problem-tp5726036.html

To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

Art Kendall
Social Research Consultants


View this message in context: Re: Exporting Data Problem
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
Art Kendall
Social Research Consultants
Reply | Threaded
Open this post in threaded view
|

Re: Exporting Data Problem

Robert Walker
In reply to this post by Morrell, Ronald

Hi... that character is a byte order mark or BOM. I learned about this the hard way, too!

 

If you are using SAVE TRANSLATE, use the /BOM=NO subcommand to exclude the mark in UTF files.

 

HTH,

 

Bob Walker

Surveys & Forecasts, LLC

www.safllc.com

 

From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Morrell, Ronald
Sent: Wednesday, May 14, 2014 4:52 PM
To: [hidden email]
Subject: Re: Exporting Data Problem

 

They are going to read the file into a mainframe UNIX system.

 

From: SPSSX(r) Discussion [[hidden email]] On Behalf Of Art Kendall
Sent: Wednesday, May 14, 2014 4:25 PM
To: [hidden email]
Subject: Re: Exporting Data Problem

 

What is the software the recipients will use?

Art Kendall
Social Research Consultants

On 5/14/2014 3:20 PM, Morrell, Ronald [via SPSSX Discussion] wrote:

I work in a Florida state agency and recently received an assignment to develop a process to send data to another state agency.  The process will become a weekly data exchange.  The office uses SPSS for many of its data functions, including exporting data.  I’ve developed syntax to capture the data needed and export it using the WRITE command.  The syntax is working, but when I FTP the file to the other agency, they see the following junk characters, , at the beginning of the data file.  This causes the file to reject before processing.  I’ve used several programs to look at the file before transmitting, and I cannot see the junk character.  Is SPSS inserting the junk characters or do I need to consider another possible cause?

 

My purpose asking the question to the forum is to eliminate SPSS as a possible cause of the junk characters.

 

WRITE   OUTFILE   = !PATH2+ 'djj_20140501095500.dat'

   /SSN (A9)

    DJJ317 (A6)

    LASTNAME (A20)

    FRSTNAME (A11)

    MI (A15)

    achaDOB (A8)

    SEX (a1)

    ReportTy (A1)

    ReportDte (A8)

    RprtPd1 (A8)

    RprtPd2 (A8)

    ConvDte (A8)

    achaadmtdte (A8)

    Filler (A33)

    acharlsdte (A8).

EXECUTE   .

 

Thank you in advance for any assistance that can be provided.

 

 

Have a Great Day!

 

Ronald A. Morrell

GOCII, Office of Research and Planning

PH: (850) 717-2637

 

If life were any better, I’d be a twin.

 

You know what, I AM!

 

Learn more about DJJ’s Roadmap to System Excellence at http://www.djj.state.fl.us/roadmap-to-system-excellence

 

 

 

 

 


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

http://spssx-discussion.1045642.n5.nabble.com/Exporting-Data-Problem-tp5726036.html

To start a new topic under SPSSX Discussion, email [hidden email]
To unsubscribe from SPSSX Discussion, click here.
NAML

 

Art Kendall
Social Research Consultants

 


View this message in context: Re: Exporting Data Problem
Sent from the SPSSX Discussion mailing list archive at Nabble.com.