BookmarkSubscribeRSS Feed
aanan1417
Quartz | Level 8

i was trying to import csv file that have 6800000 observation but when i import  csv file in sas  i got 2800000

observation only

4 REPLIES 4
andreas_lds
Jade | Level 19

Please post the code that you are using. Are there any unexpected messages in the log?

aanan1417
Quartz | Level 8

i got a massage in the log that 2800000 observation imported ..

i try to do it by clicking on proc import then next  after that i select the variable then i click next

 

Tom
Super User Tom
Super User

@aanan1417 wrote:

i was trying to import csv file that have 6800000 observation but when i import  csv file in sas  i got 2800000

observation only


That is too large a file to trust to PROC IMPORT.

Instead of "importing" the file just write a data step that will read the file.

How many variables are there? How do you want them defined?  Does the file have a header line with suggested names for the variables?

To look at the beginning of the file use a simple data step. Use the OBS= option on the INFILE statement to limit the number of lines read.  Use a bare INPUT statement to read the lines. Use the LIST statement to display the lines.

data _null_;
  infile 'myfile.csv' obs=5 ;
  input;
  list;
run;
Tom
Super User Tom
Super User

Are you running on Windows?  Perhaps the file contains the DOS end of file character?

Use the IGNOREDOSEOF option on the INFILE statement.

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
  • 4 replies
  • 1181 views
  • 2 likes
  • 3 in conversation