• Visitors can check out the Forum FAQ by clicking this link. You have to register before you can post: click the REGISTER link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below. View our Forum Privacy Policy.
  • Want to receive the latest contracting news and advice straight to your inbox? Sign up to the ContractorUK newsletter here. Every sign up will also be entered into a draw to WIN £100 Amazon vouchers!

A very basic SAS question

Collapse
X
  •  
  • Filter
  • Time
  • Show
Clear All
new posts

    A very basic SAS question

    OK I am just embarking on SAS so this is at a very low level.

    I'm trying to import an excel file into SAS but keep getting an error relating to the DBMS line

    'ERROR: DBMS type EXCEL not valid for import.'

    The book I'm using suggests this

    PROC IMPORT DATAFILE="C:\SAS Data\disk\data\tnfdata.xls"
    OUT=tnfdata
    DBMS = excel97
    REPLACE;
    SHEET="TNFdata";
    GETNAMES=YES;

    PROC PRINT DATA=tnfdata;


    but I keep getting 'ERROR: DBMS type EXCEL97 not valid for import.'

    I have tried changing the Excel 97 to 2000, 2002, 2003, 03, leaving ity out, XLS and still geep getting the same type of error. What the hell am I doing wrong with this. From looking on the net, the sytax suggested in the book should work but fails on my copy.
    Last edited by BoredBloke; 15 June 2006, 08:16.
    Rule Number 1 - Assuming that you have a valid contract in place always try to get your poo onto your timesheet, provided that the timesheet is valid for your current contract and covers the period of time that you are billing for.

    I preferred version 1!

    #2
    Have you closed the the excel workbook before running the import code?
    "Being nice costs nothing and sometimes gets you extra bacon" - Pondlife.

    Comment


      #3
      Yes it is closed

      Each time I run it I get

      "ERROR: DBMS type EXCEL not valid for import."

      Where EXCEL = whatever type of Excel I specify

      I have tried dbms = Excel, Excel 97, XLS, Excel2003, Excel03 and others.

      All give this dbms error.
      Rule Number 1 - Assuming that you have a valid contract in place always try to get your poo onto your timesheet, provided that the timesheet is valid for your current contract and covers the period of time that you are billing for.

      I preferred version 1!

      Comment


        #4
        Have you got the SAS-ACCESS PC File Formats module installed? Base SAS wont import/export to PC files without it.
        "Being nice costs nothing and sometimes gets you extra bacon" - Pondlife.

        Comment


          #5
          Originally posted by DaveB
          Have you got the SAS-ACCESS PC File Formats module installed? Base SAS wont import/export to PC files without it.
          That is correct.
          Hard Brexit now!
          #prayfornodeal

          Comment


            #6
            I can import/export manually but not via code. It also failed on the script using the delimited file.

            I am only using the learning edition so I will check to see if there are any extra things which need to be installed.

            Where do you look for the extra bits to load?
            Last edited by BoredBloke; 15 June 2006, 18:32.
            Rule Number 1 - Assuming that you have a valid contract in place always try to get your poo onto your timesheet, provided that the timesheet is valid for your current contract and covers the period of time that you are billing for.

            I preferred version 1!

            Comment


              #7
              Try this

              proc setinit; run;

              then look for SAS/ACC-PC File Formats as one of the listed modules.

              If you cant find it you need to reinstall SAS and make sure it's selected as a mosule to install.

              If it is there then have a look under file menu > Import Data and see what formats are available. If access and excel arn't there then you need to reinstall a above.

              Other than that have you tried importing the data from a csv file?
              "Being nice costs nothing and sometimes gets you extra bacon" - Pondlife.

              Comment


                #8
                Originally posted by DaveB
                Try this

                proc setinit; run;

                then look for SAS/ACC-PC File Formats as one of the listed modules.

                If you cant find it you need to reinstall SAS and make sure it's selected as a mosule to install.

                If it is there then have a look under file menu > Import Data and see what formats are available. If access and excel arn't there then you need to reinstall a above.

                Other than that have you tried importing the data from a csv file?
                The Learning Edition is unlikely to have the File Formats module installed.
                You will have to do it manually (you know, the old-fashioned way, by writing code ). The INPUT statement allows you to read from csv and the PUT statement writes csv files.
                Hard Brexit now!
                #prayfornodeal

                Comment

                Working...
                X