Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Objects authorities collection

134 views
Skip to first unread message

tomasz

unread,
Feb 2, 2007, 4:13:10 AM2/2/07
to
Hi.

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

walker.l2

unread,
Feb 2, 2007, 5:20:06 AM2/2/07
to
Have a look at the QUSLOBJ and QSYLUSRA APIs. They should do the trick
and protect you from any differences in DSPOBJD and DSPOBJAUT on
different OS/400 versions.

tomasz

unread,
Feb 2, 2007, 8:04:17 AM2/2/07
to
Thanks but unfortunatelly my skills aren't good enough to
use API - it's something completly new for me.

Regards,
Tomasz


walker.l2 napisał(a):

Karl Hanson

unread,
Feb 2, 2007, 10:30:15 AM2/2/07
to
tomasz wrote:
> Thanks but unfortunatelly my skills aren't good enough to
> use API - it's something completly new for me.
>
> walker.l2 napisał(a):
>> Have a look at the QUSLOBJ and QSYLUSRA APIs. They should do the trick
>> and protect you from any differences in DSPOBJD and DSPOBJAUT on
>> different OS/400 versions.
>>

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

Barbara Morris

unread,
Feb 2, 2007, 12:53:55 PM2/2/07
to
tomasz wrote:
>
> 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.
>

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

tomasz

unread,
Feb 5, 2007, 6:07:44 AM2/5/07
to
Thank you.

It works fine now.
I've get all I need.


Regards,
Tomasz

Barbara Morris napisał(a):

stevebond...@gmail.com

unread,
Apr 2, 2018, 3:55:37 PM4/2/18
to
How would I write the CL to an outfile that would list the authorizations for a user profile? I wanted to use DSPOBJAUT that would show a user profile authority on an authority list. Any suggestions? Thanks

Dr.UgoGagliardelli

unread,
Apr 3, 2018, 5:21:43 AM4/3/18
to
Il 02.04.2018 21.55, stevebond...@gmail.com ha scritto:
> How would I write the CL to an outfile that would list the authorizations for a user profile? I wanted to use DSPOBJAUT that would show a user profile authority on an authority list. Any suggestions? Thanks
>
Use QSYLUSRA API. That produce an output similar to DSPOBJAUT but inside
an *USRSPC object that you have to create before calling the api. Then
yo can use QUSRTVUS api to retrieve the content of the user space.
Refer to QSYLUSRA documentation to see the user space format:
https://www.ibm.com/support/knowledgecenter/ssw_i5_54/apis/qsylusra.htm
0 new messages