I run the program it come out this:
NOTE: The data set WORK.DST1 has 0 observations and 18 variables. what does it mean ? Does it mean ? My data is in csv file .
Hi,
Observations in SAS are like rows or records of data. The message you are seeing indicates that the SAS data set (table) you have created holds no rows / records.
Share your code and a representative sample of the input data that can be read by your code. Also share the log.
Regards,
Amir.
Hi Amir,
;
Thanks .You have to describe more precisely your needs.
Here are the contents of your csv file :
Trial - 2015,,,,,
,,,,,
food quality data,,,,,
,,,,,
Plot,Cultigen number,Rep,Loc,Std,1
,,,,,
6360,1,1,CIe,6,11
,,,,,
6366,2,1,CIe,6,.
What should the output dataset look like ? What are the names/formats of the columns ?
data FoodQualityData;
infile "path/filename.csv" firstobs = 6 dsd;
input Plot Cultigen number Rep Loc $ Std _1;
run;
data FoodQualityData;
infile "path/filename.csv" firstobs = 6 dsd;
input Plot Cultigen number Rep Loc $ Std _1;
run;
open your file and check from which line the data starts and mention it in firstobs option.
I found only 7 variables in the files. So, I mentioned only 7 variables in the input statement.
Ex : if the data starts from 6th line mention firstobs = 6
if it starts from 10th line then firstobs = 10
COMMENT READ QUALITY DATA;
DATA DST1;
INPUT PLOT CLe /*more , input 18 Variable*/;
DATALINES;
Hi,
If your data is in a separate csv file then there should be no need to use datalines as shown in your code. The data step you have shown is incomplete. Please copy and pate the log, showing the SAS code and any messages after it is executed.
You can use the infile statement to specify the csv file and path:
A simple example template is:
data dst1;
infile '<your-path-and-file-name.csv>' dsd;
input <your-variable-names-and-formats>;
run;
I cannot download your file, but from what @gamotte has shown it does not appear to have a clear structure which is why it would be helpful to also see the output you expect to see, based on the file you've provided, also as @gamotte has advised. You might need some extra logic in your data step to help you read in the csv file.
Regards,
Amir.
Which program ?
The log message says that SAS has created a dataset DST1 in the work library. This dataset has 18 columns but no row of data, i.e. it's an empty dataset.
Can you show the code and describe expected output.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.