BookmarkSubscribeRSS Feed
sundeep23
Obsidian | Level 7

Hi All,

             I am trying to import a csv certain observations is there a way with proc import (not with infile statement) for first obs=10 obs=100  .Thanks for the help.

Thanks,

Sundeep.

5 REPLIES 5
ballardw
Super User

I doubt you'll have much luck with proc import syntax. What is the objection to infile?

sundeep23
Obsidian | Level 7

Hi Ballardw,

Its a huge csv will file ith more number of variables .If I use infile I need to get all the formats correct to get the file to read .

Thanks,

Sundeep.

data_null__
Jade | Level 19

What makes you think PROC IMPORT will do a better job of getting it right than you will. 

Peter_C
Rhodochrosite | Level 12

Read the first 10 rows as 100 strings to review content (easier in columns).

Maybe increase that 10 if the first10 dont clarify informats.

Perhaps the supplier of a large set of data (in a csv file) could provide the data definition that defines what the informats should be.

ballardw
Super User

Use proc import on the data with a large value for guessing rows. Look in the log for the code,

copy and modify as needed such as preferred date formats, add labels, change variables that maybe should be character that get imported as numeric such as Id numbers, zip codes, phone numbers.

I go through this at least once a month with new data sources.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2381 views
  • 0 likes
  • 4 in conversation