| Date: | Mon, 14 Aug 2006 23:51:53 -0400 |
| Reply-To: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Sender: | "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU> |
| From: | Arthur Tabachneck <art297@NETSCAPE.NET> |
| Subject: | Re: Importing Variables to SAS Data Set |
|
Tom,
You probably haven't provided enough information for anyone to be sure
they would be giving good advice.
However, a couple of things you might want to consider:
First, you could import the data, treating the header row as data, use the
mixed=yes option, then delete the first row of data and assign desired
variable names. That should assure that all of your data will be read as
character.
Second, were your time variables read in as character? If so, then I
would think that you have to declare your array as character as well.
HTH,
Art
---------
On Mon, 14 Aug 2006 18:03:29 -0500, Tom A. Schmitt <schmitta@UWM.EDU>
wrote:
>Hello Group:
>
>I have a few questions concerning the SAS code below. I'm importing the
data
>with the variable names. Is there a way to convert all the variables to
the
>same type (e.g., character)? Also, for the SAS data set sci_final_pp the
>variables from sci_final do not seem to be recognized appropriately. So,
I'm
>not sure if I can create the new data set in this manner with the
assumption
>that SAS will read the variables. Thanks in advanced for any suggestions.
>
>Tom
>
>DATA _NULL_;
>PROC IMPORT DATAFILE="E:\test\sci.xls"
>OUT=sci_final REPLACE;
>GETNAMES=YES;
>RUN;
>PROC PRINT DATA=sci_final;
>RUN;
>DATA sci_final_pp;
> SET sci_final;
> array Atime [1:3] time_1_SSSci time_2_SSSci time_3_SSSci;
> do time = 1 to 3;
> sci = Atime[time];
> output;
> end;
> keep org_id student_id time sci;
>RUN;
|