>I'm like *really* confused about macro expansions and name expressions. I start with the following code:
>
>
>* Grab a couple tempfile names
>
>lcFOrange= SUBSTR(SYS(2015), 3, 10)
>lcFExpend =SUBSTR(SYS(2015), 3, 10)
>lcFCommit =SUBSTR(SYS(2015), 3, 10)
>lcFOutput =SUBSTR(SYS(2015), 3, 10)
>
>SELECT whatever into table (lcFExpend)
>
>
>This works, fine, but the (lcFExpend) then isn't a "real" alias that can be used to do things like
>
>
>WHERE (lcFExpend).fieldname="myvalue"
>
>
>I fooled around with all combinations of &lcFExpend and (lcFexpend) and sometimes things seem to work and other times not.
If you really want to use macro expansion for this, you must use two (2) '.' before the fieldname:
WHERE &lcFExpend..fieldname="myvalue"
>
>I guess my global question is, how can I use a temporary file name that is randomly generated, for a table name within a program, and then be able to delete the file name. I'd like the name to be random; (it is a multi-user program). And I need to use this the same way I would use a normal table alias.
Use a cursor instead of a table. That way the "alias" name is whatever you want it to be, and can be referenced as a normal table. A cursor may have an actual filename, but you don't need to concern yourself with that, and it will clean up after itself when you're done with it.
>
>Thanks.
>
>--- Larry