I would like to perform an simple operaion on each file in library.
First I need to collect about fies/pgms etc. from that library.
I can do it via DSPOBJD command with output *OUTFILE.
Then I would like to do DSPOBJAUT to outfile for each object from libary
(each I get from outfile created by DSPOBJD command).
I don't know how to pass variable file name from outfile (DSPOBJD) to
DSPOBJAUT command.
I know that my CL knowledge is poor so please forgive me asking such a
stupid questions.
Regards,
Tomasz
Regards,
Tomasz
walker.l2 napisał(a):
There is nothing "magic" about calling APIs. For the most part it is
the same as calling other (application) programs, and often APIs are
faster (and/or use less system resource) than the alternatives. Also
I'm guessing API experience would look good on a resumé. :)
That said, I believe in CL you can use DCLF with RCVF to receive the
records from your initial OUTFILE. Search InfoCenter and you should
find links like these:
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/cl/rcvf.htm
http://publib.boulder.ibm.com/infocenter/iseries/v5r4/index.jsp?topic=/rbam6/refof.htm
--
Karl Hanson
When you declare a file in CL, all the fields in the file are available
to your program. To see what variables you can use, check the help for
the OUTFILE parameter of the command to see what system file it uses as
a basis for the outfile. Then do DSPFFD of that file to see what the
names of the variables are. In your CL program, you would code '&'
before the variable name to indicate that it is a variable.
The help for DSPOBJD indicates that QADSPOBJ is used as the basis of the
outfile. DSPFFD of QADSPOBJ shows this for the lib/name/type fields:
ODLBNM CHAR 10 10 14 Both Library
ODOBNM CHAR 10 10 24 Both Object
ODOBTP CHAR 8 8 34 Both Object Type
And you end up with a program like this:
pgm
dclf file(QADSPOBJ)
dspobjd obj(*libl/qclsrc) objtype(*FILE) +
output(*outfile) outfile(QTEMP/DSPOBJD)
ovrdbf QADSPOBJ tofile(QTEMP/DSPOBJD)
loop:
rcvf
monmsg cpf0000 exec(goto endloop)
dspobjaut obj(&ODLBNM/&ODOBNM) +
objtype(&ODOBTP) +
output(*outfile) +
outfile(QTEMP/DSPOBJAUT) +
outmbr(*FIRST *ADD)
goto loop
endloop:
endpgm
It works fine now.
I've get all I need.
Regards,
Tomasz
Barbara Morris napisał(a):