Using QCMDEXC as a stored procedure would work except that I do not want
to hardcode the library name in the GRTOBJAUT cmd. Also, I cannot use
libl that is active when the RUNSQLSTM cmd is executed. Looks like I'll
just have to put some comments in the source telling the next person to
sure and execute the GRTOBJAUT after running the RUNSQLSTM cmd. Thanks
for the idea, though.
You can use my Compile command available at
www.think400.dk/downloads.htm to solve this problem.
I put something like this into my header and use compile to create the
object. In this example, I am creating a view but something could be
applied to an index. Just add the GRTOBJAUT to the end.
/* *_> CNLLSTSPLF SRCFILE(@2/@1) SRCMBR(@3)
/* *_> DLTF FILE(@5/@4)
/* *_> RUNSQLSTM SRCFILE(@2/@1) SRCMBR(@3) +
/* *_> DFTRDBCOL(*NONE) CLOSQLCSR(*ENDMOD) ERRLVL(20)
/* *_> MOVOBJ OBJ(*LIBL/@4) OBJTYPE(*FILE) TOLIB(@5)
/* *_> CHGLF FILE(@5/@4) WAITFILE(*IMMED)
Create View APPAYSUM As
Sum(BAGRS) As Gross,
Sum(BADIS) As Discount,
Sum(BAGRS - BADIS) As NetAmount,
Group By VNDNR,
Just add a GRTOBJAUT, etc.
/* *_> GRTOBJAUT OBJ(@5/@4) OBJTYPE(*FILE) USER(*PUBLIC) AUT(*ALL) */
This mailing list archive is Copyright 1997-2019 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact