Q
Problem solve Get help with specific problems with your technologies, process and projects.

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

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.

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 last published in April 2001

Dig Deeper on Performance

Have a question for an expert?

Please add a title for your question

Get answers from a TechTarget expert on whatever's puzzling you.

You will be able to add details on the next page.

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close