ASA Connect

 View Only
  • 1.  Proc export

    Posted 12-02-2015 11:45
    Hi All,

    I am using SAS 9.3 and I am trying to export an output as a text file. I would like to have the output with fixed width.

    proc export data= Sp_sub.
    outfile="C:\PA\Key\2015\Spring\Separate run\sp_file.txt"
    dbms=txt  replace; run;

    The error message I am getting is "DBMS type TXT not valid for export".

    Anyone has an idea on how to resolve this issue.

    Thanks for your time and input.


  • 2.  RE: Proc export

    Posted 12-02-2015 12:20

    I suggest using the "Export data..." item from the File menu.  Also at the end of that process you can save the commands for future use.

    ------------------------------
    James Baldwin
    Station Statistician
    USDA-Forest Service



  • 3.  RE: Proc export

    Posted 12-03-2015 10:41

    Hi, I used SAS enterprise Guide 7.1 it gives me similar problem just go the icon tab and select the Export tab to either CSV or any other text file you want to use it will export it asap.

    Thank you

    Kingsley Mbonu

    Graduate Student

    South Dakota State University.

    ------------------------------
    Kingsley Mbonu



  • 4.  RE: Proc export

    Posted 12-03-2015 10:42

    Remove the dot after the name of the SAS dataset and just have the file name, in the path, end with the suffix .txt and you should be good.

    Ray 

    ------------------------------
    Raymond Balise
    University of Miami, Miller School of Medicine



  • 5.  RE: Proc export

    Posted 12-03-2015 10:42

    Proc Export syntax recognizes DBMS=tab (tab-delimiters) or DBMDS=DLM (blank-delimiters) as column separators.

    ------------------------------
    Sigurd Hermansen



  • 6.  RE: Proc export

    Posted 12-03-2015 10:42

    To create a fixed-format text file, I'd suggest using the FILE statement and PUT statement within the DATA step.

    ------------------------------
    Dena Schanzer
    Public Health Agency of Canada



  • 7.  RE: Proc export

    Posted 12-03-2015 10:42

    Personally I use a null data step to create a file structure with the precise formatting that I want.  However, that might be due to the fact that I rarely use SAS in the interactive Windows environment but rather use batch mode.

    ------------------------------
    David Mangen



  • 8.  RE: Proc export

    Posted 12-03-2015 11:19

     I just "Save as...." the SAS output to a  ....lst file.  Then open that in Word, and do anything you like from there. 

    ------------------------------
    Joseph J. Locascio, Ph.D.,
    Assistant Professor of Neurology,
    Harvard Medical School,
    and Statistician,
    Memory and Movement Disorders Units,
    Massachusetts Alzheimer's Disease Research Center,
    Neurology Dept.,
    Massachusetts General Hospital (MGH),
    Boston, Massachusetts 02114
    Phone: (617) 724-7192
    Email: JLocascio@partners.org