Seems to me you are missing the @ sign in front of the second filename.
If the desire is to display the contents of the second file (i.e.
m:\taqDAILYTRF\%x) you need to preface it with the @ sign like you did for
your outer loop. If %x references a directory as opposed to a file, you
could use "m:\taqDAILYTRF\%x\*" to get a listing of all the files in that
directory.
FOR %x IN (@statsdates) (
Echo date= %x
for %y in (@m:\taqDAILYTRF\%x) (
echo tickers= %y
)
)
The above loops are almost always better off done with a DO loop due to
the fact that the above multi-line statement is in fact a single
statement. Since you have it written as a multiline statement, I assume
it is part of a batch file. Debugging becmes *much* easier when using
DO/ENDDO.
DO x IN @statsdates
Echo date= %x
DO y in @m:\taqDAILYTRF\%x
echo tickers= %y
ENDDO
ENDDO
-Scott
"JP Software Forums" <neil@jpsoft.com> wrote on 12/22/2008 02:24:17 PM:
> These nested for loops
>
> FOR %x IN (@statsdates) (
> Echo date= %x
> for %y in (m:\taqDAILYTRF\%x) (
> echo tickers= %y
> )
> )
>
> produces this result:
>
> date= 20070601
> tickers= m:\taqDAILYTRF\20070601
>
> The first loop works fine -- the second loops fails to list the
> members of m:\taqDAILYTRF\%x
>
> What am I missing?
>
>
>
>