Let's first switch to SAS terms and concepts. Columns in a SAS dataset
either have numeric typed data or character typed data. SAS does not
support mixed data types in one column (fortunately). So if you import
numbers and text in one MS Excel column, that column will almost always
be character typed. Check the properties of the column variable in PROC
CONTENTS, SQL DICTIONARY.columns, or interactively in Display Manager
SAS uses the PUT() function and an informat to convert numbers to
character variables. For numeric typed variable x, a Data step statement
along the lines of
usually works OK for integer values.
I must warn you that MS Excel encourages people to make garbage out of
good data. Many SAS programmers spend many long hours trying to
reconstruct data from heaps of loosely related cells.
From: firstname.lastname@example.org [mailto:email@example.com]
On Behalf Of Ricky
Sent: Friday, April 07, 2006 4:39 PM
Subject: Number" fields to "Text"
I have a question and I hope this is the place where I will get the
answer. I need to read an excel file, that I can do by using the PROC
IMPORT, later I need to convert all the 'Number" fields to "Text" in the
data sets. Excel file may have one or more than one column. Excel file
may have all the variable of numeric type or the text type or both. How
to do that.
Please help me.
Thank You in advance