How do I get the output of this command:
DSPAUTUSR SEQ(*GRPPRF) OUTPUT(*)
sent 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.
CPYSPLF FILE(QPAUTUSR) TOFILE(QTEMP/FILE133)
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.