Getting the output of DSPAUTUSR SEQ(*GRPPRF) OUTPUT(*) command

Getting the output of DSPAUTUSR SEQ(*GRPPRF) OUTPUT(*) command

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.

    By submitting your registration information to Search400.com you agree to receive email communications from TechTarget and TechTarget partners. We encourage you to read our Privacy Policy which contains important disclosures about how we collect and use your registration and other information. If you reside outside of the United States, by submitting this registration information you consent to having your personal data transferred to and processed in the United States. Your use of Search400.com is governed by our Terms of Use. You may contact us at webmaster@TechTarget.com.

to an outfile if the only choices are * or *print?


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