|
Jun,
There is a method to make what you are doing extremely easy, You will
need no data steps at all.. The entire text file can be read into
memory as highly ordered data with a single function where it can be
manipulated with datastep-like code to produce the output file you
want. If you are interested, contact me offline, and I will share
with you the SAS Component Language based solution. I am not quite
ready to share these powerful techniques with the entire SAS-L
community. But I will give one hint: a SCL list can be stored as a
text file and read into memory (even virtual memory if the text file
is very large) with a single function. Since I have described this
function more than once, I will only tell you directly.
Joe
On 8/16/06, Jun <junliu2004@gmail.com> wrote:
> Dear All:
>
> I have several text files. All these files contains titles and a table.
> I just want to read in the numbers appeared in the table (not include
> the number appeared in title and in the table row name and column name)
> into a SAS dataset. In the SAS dataset, I want to have three columns,
> the first column indicates at which column a particular number appeared
> in the old table, the second column indicates at which row a
> particular number appeared in the old table, the third column is the
> number. The following is one sample of the text file. Any suggestion
> will be appreciated.
>
> title
>
> ---------------------------------------------------------------------------
>
> column1 ----column2--- ---column3-----
> n % n %
>
> ----------------------------------------------------------------------------
> AAAA 22 10.2 100 100
> BBBB 33 12.2 1200 23
> CCCC 55 8.9 42 0.3
>
> ---------------------------------------------------------------------------
>
>
> The sas dataset I want to create for the above example is as follows:
>
> 1 1 22
> 1 2 33
> 1 3 55
> 2 1 10.2
> 2 2 12.2
> 2 3 8.9
> 3 1 100
> 3 2 1200
> 3 3 42
> 4 1 100
> 4 2 23
> 4 3 0.3
>
>
> Thanks,
> Jun
>
|