>>Hi Mandy,
>> What errors are you getting? What is the content of the variables?
>> Keep in mind that if you are instructing SQL to place a file in a non-existent subdirectory, SQL will fail--it will not automatically create the subdirectory. Your syntax looks fine and what you are trying to do should work. Your error is probably in the contents of your variables. I suggest halting the execution of the program just before the SQL Select statement and examining the contents of the variables. That will probably point you to the problem.
>> Regards, Chaim
>
>Hi Chaim,
>The error I'm getting is "Command contains unrecognized phrase/keyword". Here's my Select statement exactly:
>
> SELECT * FROM &y INTO TABLE c:\ird96\surveys\&x\&y WHERE acode=&x
Try:
DECLARE aTest[1.5]
IF ADIR(aTest,'c:\ird96\surveys\'+x,'D') = 0
MKDIR ('c:\ird96\surveys\'+x)
ENDIF
SELECT * from (y) INTO TABLE ('c:\ird96\surveys\'+x+'\'+y) WHERE acode = x
>
>y=SYSTEM (the name of one of my files), x=00640 (char string & code for one of my agencies), and I do have a c:\ird96\surveys\00640 directory before running the command.
>
>Will my 'WHERE acode=&x' realize that &x is a character string, not a number?
>
>I just tried doing the above but using the actual values (SYSTEM & 00640) in place of the variables and it works fine.
>
>Any ideas?
>
>Mandy