How do I convert a Windows SAS 9.2 file to Linux/Unix SAS file?

Posted on 2009-12-28
Last Modified: 2013-11-16
I am very confused by this conversion mechanism.  I've been trying to convert a Windows SAS 9.2 file to a Linux/Unix SAS file using Stat/Transfer to create the transport file (.xpt) on the Windows side and PROC COPY on the Unix side.  But on the Unix side the variable names are chopped to 8 characters and the formats are missing.  I know the Unix side handles variable names longer than 8 chars as I've used them there.  I keep running into references to the XPORT engine not supporting the larger SAS 9 variable names, but it is not clear if that is only when going to SAS V6.  There must be a way to move SAS data files between 2 systems that support long variable names and preserve the formats.  Help?
Question by:garyphunt
    LVL 9

    Expert Comment

    Have you tried just ftp'ing the file to unix?  It has worked for me in the past.  Make sure you set the ftp program to use the binary setting.  Another thing I do within SAS is PROC UPLOAD and PROC DOWNLOAD when using the RSUBMIT process on my PC SAS code.

    Author Comment

    Thanks for your ideas.  We use a product called SSH Secure File Transfer.  It has a drag and drop interface.  Moving a file directly from Red Hat Linux (that's what I found out is on the server) to Windows works fine between the different dataset formats.  Windows SAS can read it although it gives a Note indicating it realizes it is from a different platform.  However, I've had no luck dragging the file from Windows to Linux.  Linux SAS (9.2 also) can't read it.  Haven't ever used PROC UPLOAD, but I'll look into that.  FYI, I have to Zip the files before moving them as they are too large to move otherwise.  If PROC UPLOAD works across the network without compression, it might not be feasible.
    LVL 9

    Accepted Solution

    PROC UPLOAD should work.  I've uploaded .txt, .pdf, .zip files in the past.  Let me know if that works.  Not sure if you checked if the ftp transfer mode is binary or text.  I know I have to force my transfer mode to binary to work.


    Author Comment

    Again, thanks for your feedback.  The solution I finally found involved CPORT and CIMPORT.  I still don't know why PROC COPY using the XPORT engine wouldn't work since it was going between two V9 SAS platforms.  But your suggestion of using PROC UPLOAD and DOWNLOAD was an interesting twist that I hadn't thought about.   This was the only response I got so I'm closing the case with your recommendation.

    Author Closing Comment

    This didn't help me understand why the XPORT engine behaved as it did, but it did make me aware of a new option and I'll be able to explore this path when time allows.  The solution I finally used was using CPORT and CIMPORT.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Introduction: I have seen many questions on EE and elsewhere, asking about how to find either gaps in lists of numbers (id field, usually) ranges of values or dates overlapping date ranges combined date ranges I thought it would be a good …
    I guess that all of us know that caching the data usually increase the performance, but I worried if all of us are aware about the risk that caching the data provides and how to minimize this.  That’s the reason why I decided to write this short art…
    Video by: Steve
    Using examples as well as descriptions, step through each of the common simple join types, explaining differences in syntax, differences in expected outputs and showing how the queries run along with the actual outputs based upon a simple set of dem…
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    760 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    7 Experts available now in Live!

    Get 1:1 Help Now