BookmarkSubscribeRSS Feed
BigMac
Calcite | Level 5

libname tgeg "C:|Users\USER00000001\Documents\My SAS Files\9.4";
ERROR: Invalid physical name for library TGEG.
ERROR: Error in the LIBNAME statement.
94
95 proc import out=sasuser.pasadata
96 datafile="C\Users\USER00000001\Documents/My SAS Files\9.4\TEMP1.pooled_PASA_merge.SAS7bdat";
ERROR: Unable to determine datasource type. Please use the DBMS= option.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

 

97 data sasuser.pasadata;set pooled_PASA_merge.SAS7bdat;
ERROR: Libref 'pooled_PASA_merge' exceeds 8 characters.
ERROR: File WORK.SAS7BDAT.DATA does not exist.
98 run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set SASUSER.PASADATA may be incomplete. When this step was stopped there were
0 observations and 0 variables.
WARNING: Data set SASUSER.PASADATA was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.07 seconds
cpu time 0.01 seconds

 

4 REPLIES 4
Reeza
Super User
Welcome to the SAS forum. I see your code is not working, but it's also not valid code so I'm not sure what you're trying to do.

You do not import a sas7bdat file, you can just use them as is, from the library.

You also don't state what you're trying to do or what your question is, so it's hard to help you at this point in time.
JBailey
Barite | Level 11

Hi @BigMac ,

 

You are using OS file locations and names where you should use LIBNAME.SASDataSetName. 

 

Your tgeg LIBNAME statement doesn't work because of a problem in the directory structure you specified. Include it "as SAS code". (little running man icon in the edit dialog so we can see it). It is likely that you are pointing to a directory that doesn't exist or you have an invalid character in the command. I don't think you are pointing to a directory that contains SAS data sets. 

 

You don't need to import a *.sas7bdat file; you can point a LIBNAME statement at it the directory and read the file.

 

Ditto the DATA step problem.

 

You should play around with SASHELP.cars.

 

SASHELP is an autoassigned SAS Library. You should be able to run the following code, successfully.

 

data work.cars;
   set sashelp.cars;
run;

 

Best wishes,

Jeff

ballardw
Super User

@BigMac wrote:

libname tgeg "C:|Users\USER00000001\Documents\My SAS Files\9.4";
ERROR: Invalid physical name for library TGEG.
ERROR: Error in the LIBNAME statement.
94
95 proc import out=sasuser.pasadata
96 datafile="C\Users\USER00000001\Documents/My SAS Files\9.4\TEMP1.pooled_PASA_merge.SAS7bdat";
ERROR: Unable to determine datasource type. Please use the DBMS= option.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE IMPORT used (Total process time):
real time 0.00 seconds
cpu time 0.00 seconds

 

97 data sasuser.pasadata;set pooled_PASA_merge.SAS7bdat;
ERROR: Libref 'pooled_PASA_merge' exceeds 8 characters.
ERROR: File WORK.SAS7BDAT.DATA does not exist.
98 run;

NOTE: The SAS System stopped processing this step because of errors.
WARNING: The data set SASUSER.PASADATA may be incomplete. When this step was stopped there were
0 observations and 0 variables.
WARNING: Data set SASUSER.PASADATA was not replaced because this step was stopped.
NOTE: DATA statement used (Total process time):
real time 0.07 seconds
cpu time 0.01 seconds

 


You start with an illegal path for Windows syntax.

 

Then miss a : and change characters for the folder separators in another path.

 

A SET statement in the data step expects to see LIBNAME.Datasetname or a fully qualified file name in quotes ( "c:\folder\subfolder\datasetname.sas7bdat" ). Since you used pooled_PASA_merge.SAS7bdat then the pooled_PASA_merge was treated as the library name (the bit before the period) and libraries can only be 8 characters long. This would have been looking for a data set named SAS7BDAT.

 

Kurt_Bremser
Super User

On top of what the others said, you do not import a .sas7bdat file, you just use it through a library definition, as it is already a SAS dataset.

But

TEMP1.pooled_PASA_merge.SAS7bdat

is not a valid name for a .sas7bdat file. A dataset name (everything before the .sas7bdat) can only contain letters, digits and underlines (no periods!), and must not start with a digit. And the whole filename (including the extension) must be lowercase.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 4 replies
  • 858 views
  • 3 likes
  • 5 in conversation