Date: Fri, 9 Sep 2005 20:19:12 -0700
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
Subject: Re: How to input data from different column for different rows
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Dan Nordlund few days ago suggested following to me for my similar problem:
Input x 1 y 2-5 z 6-8 d :mmddyy10. t :time8. xx 30-34 yy 35-40 zz 41-42;
Put d=date9. t=time8.;
86857484 1/1/2005 8:05:59 5849384343535
28493834 11/29/2004 16:59:59 2939283985948
Seems the ":" before the datatype identifier may be the secret. More
specific help on that is in the SAS help.
> I am wondering if there is a way to use "input" statement to read in
> data that are in different columns.
> For example, if I have the following data:
> 77343 A XX XX
> 2 7 B XX XX
> 2 2 2 c XX XX
> I want to start reading in the data from the letters, i.e. the first
> variable value for each obs will be A, B, and c respectively. However,
> A, B, C are not in the same column. The data before A, b, and c is
> really a mess so you can't use list\formatted input.
> I am new to SAS. please forgive me if this question is stupid.
> Thank you in advance.