You could use CL, do a DSPOBJD on all the *DEVD's to an outfile then
RPG it or Query it or download it into excel etc.
You can do:
DSPOBJD OBJ(*ALL) OBJTYPE(*DEVD) OUTPUT(*OUTFILE) OUTFILE(QTEMP/FILE)
Regards,
Tomasz
Hi.
I would write a CL to make DSPOBJD OBJ(*ALL) OBJTYPE(*DEVD) to outfile.
And then another part of CL would read from that outfile names of DEVD
which are DSPVRT type and make DSPDEVD for that specific device names.
Result can be write into file or spoolfile.
Regards,
Tomasz
The output requirements make this look like a job for a proper HLL
(e.g. RPG or COBOL) program rather than CL.
--
Vriendelijke groeten / Best regards,
René H. Hartman
www.hac-maarssen.nl
Regards, Chuck
--
All comments provided "as is" with no warranties of any kind
whatsoever and may not represent positions, strategies, nor views of my
employer
QDCRDEVD is an API and not a command. You have to call it like any other program and pass a specific
parameter list to it:
/* --------------------------------------------------------------- */
/* - Variable declarations - */
/* --------------------------------------------------------------- */
Dcl &RcvVar *Char ( 892 )
Dcl &RcvVarLen *Char ( 4 ) ( X'0000037C' )
Dcl &Format *Char ( 8 ) ( 'DEVD0600' )
Dcl &DevD *Char ( 10 )
Dcl &APIError *Char ( 8 ) ( X'0000000000000000' )
Dcl &IPAddr *Char ( 15 )
/* --------------------------------------------------------------- */
/* - Retrieve current device name and its dotted IP address - */
/* --------------------------------------------------------------- */
ChgVar VAR(&DevD) VALUE('theNameOfTheDeviceGoesHere')
Call QDCRDEVD +
( &RcvVar +
&RcvVarLen +
&Format +
&DevD +
&APIError )
ChgVar &IPAddr ( %Sst( &RcvVar 878 15 ) )
Thomas Raddatz.
jerry chapman schrieb:
"Thomas Raddatz" <thomas....@tools400.de> wrote in message
news:468A7513...@tools400.de...
>> I compiled and ran the listing you sent. It got an error, and when I looked
>> in QEZJOBLOG it said 6 parameters were supplied when 5 were required. I
It should not make any difference whether you call the program with format 'DEVD0600' or 'DEVD1100'.
Hence I do not understand why you get that error message when using format 'DEVD0600'. The program
just runs fine when I compile and call it. I used option 14 to compile that CLLE program:
Pgm
Dcl &RcvVar *Char ( 892 )
Dcl &RcvVarLen *Char ( 4 ) ( X'0000037C' )
Dcl &Format *Char ( 8 ) ( 'DEVD0600' )
Dcl &DevD *Char ( 10 )
Dcl &APIError *Char ( 8 ) ( X'0000000000000000' )
Dcl &IPAddr *Char ( 15 )
ChgVar Var(&DevD) VALUE('W001001701')
Call QDCRDEVD +
( &RcvVar +
&RcvVarLen +
&Format +
&DevD +
&APIError )
ChgVar &IPAddr ( %Sst( &RcvVar 878 15 ) )
SNDPGMMSG MSGID(CPF9897) MSGF(QCPFMSG) +
MSGDTA('IP-Addr:' *BCAT &IPAddr) +
TOPGMQ(*PRV (*CTLBDY))
EndPgm
Here is what I would do if I was you:
1. Do a DSPOBJD OBJ(*ALL) OBJTYPE(*DEVD) OUTPUT(*OUTFILE) OUTFILE(QTEMP/OBJD)
Check if it is possible to recognize the device descriptions you need from what is written to OBJD. I
guess that you can use ODOBAT for that purpose. Since we do not have any remote printers (just remote
OUTQs) I can not be more specific.
2. Given that you can recognize the device descriptions you need, continue with this:
2.1 Write a CL that does the DSPOBJD to an output file in QTEMP.
2.2 Call a RPGLE program that opens the output file in QTEMP for UPDATE!
You can use the EXTFILE keyword to specify the file in QTEMP.
2.3 Read each entry and delete every non printer device description.
2.4 For each printer device description:
Call QDCRDEVD with format DEVD1100 to get its IP address.
Put the IP address into ODLBL and update the record.
Try the QDCRDEVD API.
Thomas.
walker.l2 schrieb: