Which input method to use?

Accepted Solution Solved
Reply
New Contributor
Posts: 3
Accepted Solution

Which input method to use?

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


Accepted Solutions
Solution
‎09-11-2017 07:34 AM
SAS Super FREQ
Posts: 9,029

Re: Which input method to use?

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


All Replies
Solution
‎09-11-2017 07:34 AM
SAS Super FREQ
Posts: 9,029

Re: Which input method to use?

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
New Contributor
Posts: 3

Re: Which input method to use?

Posted in reply to Cynthia_sas

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

Super User
Super User
Posts: 7,388

Re: Which input method to use?

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.

 

 

 

 

New Contributor
Posts: 3

Re: Which input method to use?

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

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 4 replies
  • 131 views
  • 1 like
  • 3 in conversation