Date: Tue, 8 Jan 2008 14:51:47 -0500
Reply-To: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: "Fehd, Ronald J. (CDC/CCHIS/NCPHI)" <rjf2@CDC.GOV>
Subject: Re: Can you do array processing and a proc nlp from within proc
iml?
In-Reply-To: <200801081630.m08BuH87009685@malibu.cc.uga.edu>
Content-Type: text/plain; charset=us-ascii
I don't know about using IML to do list processing
but my paper on Writing Testing-Aware Programs
has example programs which you can use to generate calls
to either parameterized includes or macros
http://www.sascommunity.org/wiki/Writing_Testing_Aware_Programs
Ron Fehd the macro maven CDC Atlanta GA USA RJF2 at cdc dot gov
> -----Original Message-----
> From: owner-sas-l@listserv.uga.edu
> [mailto:owner-sas-l@listserv.uga.edu] On Behalf Of Randall Powers
> Sent: Tuesday, January 08, 2008 11:31 AM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Can you do array processing and a proc nlp from
> within proc iml?
>
> Sorry this is rambling and longwinded. Any input anybody can
> give would be
> helpful! If what I'm saying/asking doesn't make sense, it's probably
> because of my newbieness...I'd be happy to clarify.
>
> So here is what I'm doing.
>
> I'm using proc iml to create a matrix of values. The number
> of columns and
> rows may vary, but for arguments sake, let's say 50 rows and
> 5 columns. I'm
> using RANDMULTIMOMIAL to create matrix X, which is 50x5. What
> I'd like to
> do is somehow convert that matrix into a 50x5 array (50 rows,
> 5 columns),
> which I would then use as input in a proc nlp.
>
> For example:
>
> 5 4 6 2 5
> 4 5 4 4 5
> 3 7 3 6 3
> .........
> .........
> etc
>
> Does this seem possible? Can it all be done in the proc iml,
> or do I have
> to break it up and do it outside of proc iml?
>
> One thing I did try was to create an output file which I'm
> thinking could
> then be used to read the values of X into an array in a data step. The
> output file created from proc iml assigns each value of the matrix a
> separate observation. Thus, the example below gives a SAS
> data set with:
>
> OBS X
> 1 5
> 2 4
> 3 6
> 4 2
> 5 5
> 6 4
> 7 5
> 8 4
> 9 4
> 10 5
> etc. (in this example, I would have 50x5=250 obs)
>
> How would I then capture the value of X for the first five
> observations
> into an array, the second five values into another array, the
> third five
> values into a third array, etc. so that I would have 50 arrays of five
> values (or a multidimensional array of size {50,5} containing
> all of the
> values? I would then send this array to my proc nlp, where it
> would be used.
>
>
|