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

Hello All, 

This is my first post and i am new in Sas programming.I just started reading Sas a week ago for my class and i am confused with so many ways we can read raw data.My question is how to know which input method to use for read a raw data.How do we know when to use list input, column input or formatted input. Is there a particular way to figure it out or its just more practice.

 

Thanks in advance

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ
Hi:
Programming 1 is our free introductory class, when you activate the e-learning version of the class. We explain reasons for using different techniques in the class.

The bottom line is that you have to know what the structure of your raw data file looks like, is it space delimited? is it tab delimited? is it comma delimited? is the data in fixed columns? is the data standard or non-standard? do you need to use read the data a special way? do you have date values? All of these things can factor into the method you use to read the data.

You can activate the free Programming 1 class by clicking the link at the top of this page
https://support.sas.com/edu/elearning.html?ctry=us&productType=library
(you will have to log onto your SAS Profile to complete the activation process).

cynthia

View solution in original post

4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
Programming 1 is our free introductory class, when you activate the e-learning version of the class. We explain reasons for using different techniques in the class.

The bottom line is that you have to know what the structure of your raw data file looks like, is it space delimited? is it tab delimited? is it comma delimited? is the data in fixed columns? is the data standard or non-standard? do you need to use read the data a special way? do you have date values? All of these things can factor into the method you use to read the data.

You can activate the free Programming 1 class by clicking the link at the top of this page
https://support.sas.com/edu/elearning.html?ctry=us&productType=library
(you will have to log onto your SAS Profile to complete the activation process).

cynthia
anikhana
Calcite | Level 5

Thank you for your suggestion. I will definately look into that free learning course.

Tom
Super User Tom
Super User

The key thing is how is the file you are reading formatted.  

 

If it is delimited, like a CSV file, then list mode input is best, use the DSD option on the INFILE statement.  You can even try using PROC IMPORT to make guess at what your variables are and how they should be defined.

 

If it is fixed format then read it using either formats or column positions.  

 

If it is space delimited then you can sometimes use list mode, but you need to make sure that missing values are properly indicated or else the input will read the values out of order because it cant' tell that the extra spaces mean there is empty value.

 

 

 

 

anikhana
Calcite | Level 5

Thank you Tom. It gave me better idea on how to read raw data files.

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!

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
  • 513 views
  • 1 like
  • 3 in conversation