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.

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

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