How do I get the output of this command:
DSPAUTUSR SEQ(*GRPPRF) OUTPUT(*)
sent
Requires Free Membership to View
Register today to access targeted resources from our editorial writers and independent industry experts including news, tips, and advice to help you do your job more efficiently and effectively. Stay informed on the hottest topics and biggest challenges faced by IT professionals working with iSeries products and services.
There are two ways to do this, one is to copy your spool file to a Physical file (easier) and the other is to use an API(harder).
The following code shows how you would copy the spooled output to a flat physical file. If you are intending to read this in a program, you will probably want to write a program to read this file and format the fields into a database file with DDS field names.
PGM
DSPAUTUSR SEQ(*GRPPRF)
OUTPUT(*PRINT)
CRTPF
FILE(QTEMP/FILE133)
CPYSPLF FILE(QPAUTUSR) TOFILE(QTEMP/FILE133)
JOB(*) +
SPLNBR(*LAST)
ENDPGM
The second way is to use an API. API QSYLAUTU will list similar information as the DSPAUTUSR, but it will list it to a user space. You could then write a program to read the user space and output it to a file. Unless you are familiar with APIs and the use of user spaces and offsets, this is generally a more difficult way to accomplish your goal. If done properly, the use of an API will ensure release to release compatibility and good execution speed, whereas, parsing a flat spool file may not. More information on this API can be found in the OS/400 Security Server API manual at the AS/400 online library.
This was first published in April 2001