MET MA 603: SAS Programming and Applications
MET MA 603:
SAS Programming and Applications
Representing Tabular Data
1
1
Tables
A table is one of the fundamental ways of organizing data. In a data table, data is organized into rows and columns.
Often, tabular data must be shared between people or programs. To effectively communicate tabular data, it must be possible to identify where each row and column begin and end.
BostonMA610000
ChicagoIL2410000SeattleWA415000
The data above contains
three variables: City, State, and Population, and
three observations: Boston, Chicago, and Seattle
We can understand this by recognizing the pattern, but how could a computer know where one observation or variable ends and the next ones starts?
2
2
Delimited Data
A delimiter is a special character that indicates separation between pieces of information.
Any character can be used as a delimiter, with common choices being commas, tabs, spaces, or pipes. The delimiter should be a character that does not otherwise appear in the data.
When reading the data, the computer uses the delimiter to identify the starting and ending point of each variable. The delimiter character itself will not appear in the result.
Comma-delimited Space-delimited Pipe-delimited
Boston,MA,610000 Boston MA 610000 Boston|MA|610000
Chicago,IL,2410000 Chicago IL 2410000 Chicago|IL|2410000
Seattle,WA,415000 Seattle WA 415000 Seattle|WA|415000
Terms used to describe delimited formats include CSV (comma-separated values), delimited file, and flat file.
3
3
Fixed-Width Data
A fixed-width file stores each variable in distinct columns.
When reading the data, the computer looks in a specific place for each piece of information.
Since some observations may have different lengths than others, it is usually necessary to “pad” shorter observations with trailing spaces (for character data) or leading zeros (for numeric data).
Monospace fonts make fixed-width data easier to read for the human eye.
123456789012345678 123456789012345678
Boston MA 0610000 Boston MA 610000
Chicago IL 2410000 Chicago IL 2410000
Seattle WA 0415000 Seattle WA 415000
4
4
/docProps/thumbnail.jpeg