Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need USRPRF information

Status
Not open for further replies.

PaulaJ

Programmer
Jun 20, 2000
130
US
We are fighting printer and session confusions on our V4R3 AS400. I need to identify what OUTQs and Printer Devices are assigned to each device and User Profile. Dumping the DSPOBJD to an Outfile does not supply this information. Is there a way to retrieve this information en masse, or do I have to display each Device, Profile, and Job Description?
 
If you don't mind writing a program, you can use the APIs that exist. I don't know which one's, but I am sure there is one that would help. But of course by the time that is written, you might have already gone through all of the user profiles. Mike Wills
AS400 Programmer
 
The user profiles should be easy:
1. Issue the command: DSPUSRPRF USRPRF(*ALL) OUTPUT(*OUTFILE) +
OUTFILE(QGPL/USRPRF)
2. You can then run a query over the outfile. UPOTQU will be the
Output queue field, and UPOTQL will be the Output queue library
field.


The device descriptions are a little trickier. The following CL
program and query can be used to get the information you are
looking for. The CL program will generate and later delete a spooled
file for each device on your system. It is not very fancy but it
works. The final result will be a report which lists each device and
output queue like this:
Device description . . . . . . . . : DEVD CMPA1
Output queue . . . . . . . . . . . : OUTQ *DEV
Device description . . . . . . . . : DEVD CMPA2
Output queue . . . . . . . . . . . : OUTQ *DEV
Device description . . . . . . . . : DEVD CMPB1
Output queue . . . . . . . . . . . : OUTQ *DEV

I hope this helps!

CL Program
==========
PGM

DCL VAR(&COUNTER) TYPE(*DEC) LEN(4)
DCL VAR(&COUNTER2) TYPE(*DEC) LEN(4)
DCLF FILE(QGPL/XOUTQ) RCDFMT(*ALL)

DSPOBJD OBJ(*ALL/*ALL) OBJTYPE(*DEVD) +
OUTPUT(*OUTFILE) OUTFILE(QGPL/XOUTQ)

READFILE: RCVF
MONMSG MSGID(CPF0864) EXEC(GOTO CMDLBL(EOF))
DSPDEVD DEVD(&ODOBNM) OUTPUT(*PRINT) OPTION(*BASIC)
CHGVAR VAR(&COUNTER) VALUE(&COUNTER + 1)
GOTO CMDLBL(READFILE)
EOF:

CRTPF FILE(QGPL/XOUTQ2) RCDLEN(135)
START: CHGVAR VAR(&COUNTER2) VALUE(&COUNTER2 + 1)
CPYSPLF FILE(QPDCDEV) TOFILE(QGPL/XOUTQ2) +
SPLNBR(&COUNTER2) MBROPT(*ADD)
DLTSPLF FILE(QPDCDEV) SPLNBR(&COUNTER2)
IF COND(&COUNTER2 < &COUNTER) THEN(GOTO +
CMDLBL(START))

RUNQRY QRY(QGPL/FND_OUTQ)

RETURN
ENDPGM

Query Definition
================
Query . . . . . . . . . . . . . . . . . FND_OUTQ
Library . . . . . . . . . . . . . . . QGPL

Selected files
ID File Library Member Record Format
T01 XOUTQ2 QGPL XOUTQ2 XOUTQ2

Result fields
Name Expression Column Heading
A substr(xoutq2, 2, 18)
B substr(xoutq2, 2, 12)
C substr(xoutq2, 1, 100)

Select record tests
AND/OR Field Test Value
A EQ 'Device description'
OR B EQ 'Output queue'

Ordering of selected fields
Field Sort Ascending/ Break Field
Name Priority Descending Level Text
C

Selected output attributes
Output type . . . . . . . . . . . . . . Printer
Form of output . . . . . . . . . . . . Detail
Line wrapping . . . . . . . . . . . . . No
 
Thanks, the DSPUSRPRF command was exactly what I needed?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top