Help using Base SAS procedures

Importing .sasbat

Reply
Contributor
Posts: 59

Importing .sasbat

libname adhoc_vb  pcfiles

path  = '//gaserver/myfile.sas7bat'

server= "2233";

port = 2234;

proc import datafile = '//gaserver/myfile.sas7bat'

out = order1;

dbms =

server= "2233";

run;

I want to import ths file called myfile.sasbat.  In this case what would the dbms be called or is there another way to import a file with the .sasbat file extension?

Frequent Contributor
Frequent Contributor
Posts: 83

Re: Importing .sasbat

Posted in reply to omega1983

You don't need to import a sas data.
If your library is defined ok then you can open the data directly. Just check if the libname is successful.

Respected Advisor
Posts: 4,173

Re: Importing .sasbat

Posted in reply to omega1983

As Mit wrote: The data is already stored as a SAS file so you need only to define a libname to access it within your SAS program, e.g:

libname mylib '' '//gaserver';

proc print data=mylib.myfile;

run;

Occasional Contributor
Posts: 9

Re: Importing .sasbat

Posted in reply to omega1983

I have a related question that isn't answered yet.

I also have a .sasbat file.  I want to use proc import so that I don't have to list the near hundred variables in an input statement.  Is there no way to get around this?

Super User
Posts: 5,429

Re: Importing .sasbat

sasbat is not a common file suffix that I'm aware of. What file type is it?

What does it look like when opened in Notepad/vi?

Data never sleeps
Occasional Contributor
Posts: 9

Re: Importing .sasbat

It cannot be opened in anything but SAS.  Otherwise it's giberish.  Not an original file but I don't have access to an original file.

Super User
Posts: 7,799

Re: Importing .sasbat

Rename it to .sas7bdat, put it into a location where you have assigned a libname, and see if it is a valid SAS dataset. If not, discard.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Occasional Contributor
Posts: 9

Re: Importing .sasbat

Posted in reply to KurtBremser

It's a valid dataset. 

How do I get around listing each variable name?

Super User
Posts: 7,799

Re: Importing .sasbat

You don't need to import it, just use it.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Ask a Question
Discussion stats
  • 8 replies
  • 423 views
  • 0 likes
  • 6 in conversation