BookmarkSubscribeRSS Feed
Jayde
Fluorite | Level 6

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.

5 REPLIES 5
Tom
Super User Tom
Super User

@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).

Jayde
Fluorite | Level 6

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. 

Tom
Super User Tom
Super User

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?

Jayde
Fluorite | Level 6

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

Jayde
Fluorite | Level 6

Hi Tom, you know what. I did get the wrong file. Crazy....

 

Thanks a lot.

 

Best regards,

Jayde

SAS Innovate 2025: Call for Content

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 16. Read more here about why you should contribute and what is in it for you!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 978 views
  • 2 likes
  • 2 in conversation