DATA "E:\Essentials\Information.";
INPUT ID $ 1-3 SBP 4-6 DBP 7-9 GENDER $ 10 AGE 11-12 WT 13-15;
DATALINES;
001120 80M15115
002130 70F25180
003140100M89170
004120 80F30150
005125 80F20110
;
RUN;
PROC MEANS;
RUN;
After running this..The log window says..........
Your problem is not in creating a library, but in creating a dataset, so I corrected the subject line.
You need to supply a valid dataset name in a data statement. The dataset name cane either be a single-level name (max. 32 characters, letters, digits, underlines, must start with a letter or underline), or a two-level name with a library and dataset name.
The library name is assigned with a libname statement and has a maximum length of 8.
You might want to do this:
libname mylib "E:\Essentials\Information";
data mylib.mydataset;
input ......
Hi,
DATA statement is used for creating SAS Datasets. Syntax for DATA statement is DATA <libref.>SAS-data-set; libref is SAS library reference which is defined by LIBNAME statement syntax LIBNAME libref 'your-SAS-data-library'; You can give your physical path in quotes and define a library and later reference the library.(Note: Rules for creating SAS library depends on operating system, but advised to have 8 characters). If you miss the libref then SAS will create a temporary table in WORK library.
Assuming that you are trying to reference the dataset by its physical name then I see two possible issues with that name.
1) You have used an invalid extension for the filename. Either use .sas7bdat or do not add any extension.
data "E:\Essentials\Information";
data "E:\Essentials\Information.sas7bdat";
2) The path is wrong. Either E:\Essentials does not exist. Or E:\Essentials\Information is a directory and cannot also be used for a filename.
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.