BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
aanan1417
Quartz | Level 8

trying to import excel sheet that contain 19 variable .but when i import this excel sheet only two column were export out of 19

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

@aanan1417 wrote:

Hi Sir,

 

i m trying to import csv file that consist of 20 variable and 6400000 observation.

but the issue is few observation are blank due to this i am getting data only 2400000


What code did you run?  Here is how to structure a data step to read a delimited file (such as a CSV file).

data want;
  infile "filename" dsd firstobs=2 truncover ;
  input var1-var20;
run;

The DSD option tells it to properly handle empty values and quoted values.  The TRUNCOVER option tells it to properly handle lines with fewer than 20 values.  The FIRSTOBS=2 option tells it to skip the header row, remove if your file does not have a header row.

Adjust the INPUT statement to match the variable names and types needed for your file.  The syntax shown will work if all of the variable are numeric.

View solution in original post

8 REPLIES 8
andreas_lds
Jade | Level 19

Please post code and log, so that we the what's happening actually.

aanan1417
Quartz | Level 8

Hi Sir,

 

i m trying to import excel file that consist of 20 variable and 6400000.

but the issue is few observation are blank due to this i am getting data only 2400000

Ksharp
Super User
That is impossible. Excel only can have one million obs .
Are you talking about CSV ?
Post your sas code. some expert like @Tom would give you some advice .
andreas_lds
Jade | Level 19

I have merged your posts, it seems as if they are about the same problem.

As requested earlier: post code + log, so that we see, what you are doing.

aanan1417
Quartz | Level 8

Hi Sir,

 

i m trying to import csv file that consist of 20 variable and 6400000 observation.

but the issue is few observation are blank due to this i am getting data only 2400000

ballardw
Super User

Show your code.

Show the log.

 

CSV files are read with a data step generated by Proc Import and the actual content of the data can be critical.

 

Tom
Super User Tom
Super User

@aanan1417 wrote:

Hi Sir,

 

i m trying to import csv file that consist of 20 variable and 6400000 observation.

but the issue is few observation are blank due to this i am getting data only 2400000


What code did you run?  Here is how to structure a data step to read a delimited file (such as a CSV file).

data want;
  infile "filename" dsd firstobs=2 truncover ;
  input var1-var20;
run;

The DSD option tells it to properly handle empty values and quoted values.  The TRUNCOVER option tells it to properly handle lines with fewer than 20 values.  The FIRSTOBS=2 option tells it to skip the header row, remove if your file does not have a header row.

Adjust the INPUT statement to match the variable names and types needed for your file.  The syntax shown will work if all of the variable are numeric.

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!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 8 replies
  • 838 views
  • 2 likes
  • 6 in conversation