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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

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