I am creating a .csv file from a sas dataset by using the following:
Proc export data=final dbms=csv
outfile ="C:\project\final.csv" dbms=csv
replace;
run;
The file was created with 2163 records instead of 2482. There are some records with many missing values(but not all missing values) were not in the datasets. Any reason? How could I solve this? Thank you.
@Jayde wrote:
I am creating a .csv file from a sas dataset by using the following:
Proc export data=final dbms=csv
outfile ="C:\project\final.csv" dbms=csv
replace;
run;
The file was created with 2163 records instead of 2482. There are some records with many missing values(but not all missing values) were not in the datasets. Any reason? How could I solve this? Thank you.
I doubt that PROC EXPORT wrote the wrong number of lines. What did the notes in the log show?
How did you come up with those two numbers? Is 2,482 the number of observations in FINAL? How did you determine the text file only had 2,163 lines (or does it have 2,164 lines since there should be a header line).
Thanks for your response, Tom.
There were 2482 records in the final sas dataset. There were totally 2163 records with 1 records as header line. so the total records in the .csv file is 2162.
What did the notes in the log show?
What do the notes in the log show when you run this?
data _null_;
infile "C:\project\final.csv";
input;
run;
Are you sure you are looking at the same file?
Hi Tom,
Thank you for trying to figure this out. I am creating a final sas dataset and an excel .csv at the same time. The records for sas dataset and excel file are different. There is no questioning about that.
Jayde
Hi Tom, you know what. I did get the wrong file. Crazy....
Thanks a lot.
Best regards,
Jayde
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.