I'm sure this is easy, but I'm stumped after trying all sorts of 
variations with no success.  Here's a demo setup:

t1=: '2009-09-04';'2009-09-03';'2009-09-02';'2009-09-01'
t2=: '9345.36';'9282.03';'9306.21';'9492.32'
t=: t1 ,: t2

+----------+----------+----------+----------+
|2009-09-04|2009-09-03|2009-09-02|2009-09-01|
+----------+----------+----------+----------+
|9345.36   |9282.03   |9306.21   |9492.32   |
+----------+----------+----------+----------+

mm=. 1 1 1 1 0 1 1 0 1 1    NB. yyyy-mm-dd --> yyyymmdd

In the real world, t1 and t2 (and several additional rows) have over 
20,000 values of market data.  What I'm trying (unsuccessfully) to do 
is to apply mm as a mask to each of the values of row 0{t using the # 
(copy) verb.  For example:

0{0{t  is  '2009-09-04'   and   mm # > 0{0{t  is  '20090904'
1{0{t  is  '2009-09-03'   and   mm # > 1{0{t  is  '20090903'
and so on.

I can't figure out how to make # apply to all the values in the row at 
once (I can't even figure out how to do it with a 'for' loop)--no 
matter what I've tried, I keep getting (length, syntax, and limit) 
error messages.  I'd appreciate any help that y'all can offer.  Thanks 
in advance!

Harvey

----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to