On 6/11/15 6:56 AM, Johnson, Tracy wrote:
> I noticed there is no easy way in MPEX to return the value of LDEV if it is a spooled and active printer
...
Not anywhere near a complete solution, but a suggestion for an avenue of
exploration:
: run sh.hpbin.sys
$ callci showdev | grep SPOOLED
6 SPOOLED DOWN
17 SPOOLED SPOOLER OUT
18 SPOOLED SPOOLER OUT
$
$ callci showdev | grep SPOOLED | awk '{print $1}'
6
17
18
$
$ MY_LDEV_LIST=$(callci showdev | grep SPOOLED | awk '{print $1}')
$ echo $MY_LDEV_LIST
6 17 18
$
$ for LDEV in $MY_LDEV_LIST ; do
> echo do something with LDEV $LDEV
> done
do something with LDEV 6
do something with LDEV 17
do something with LDEV 18
$
Regards,
Barry Lake
Allegro Consultants, Inc.
On 6/11/15 6:56 AM, Johnson, Tracy wrote:
> I noticed there is no easy way in MPEX to return the value of LDEV if it is a spooled and active printer. Returning an active spool file is easy but the returning the LDEV is not.
>
> In other words there is no such thing:
>
> IF LDEV = SPOOLED true AND SPOOLER(LDEV)=ACTIVE
> ECHO ***** DO SOMETHING TO LDEV HERE *****
> ENDIF
>
> The following method is slow and tedius because we have 15000 spool files. It takes 6 seconds to pass through each ldev and check 15000 spoolfles before it goes to the next LDEV.
>
> We have 1200 ldevs, 50 are disc, 350 are sessions, 800 printers, The below would must also check nonexistent LDEVs to the upper limit of LDEV numbering, At 6 seconds per LDEV, the below test would take seven and a half hours:
>
> REPEAT
> CONTINUE
> SHOWOUT @[log in to unmask]@(SPOOL.DEVICE="!i" AND SPOOL.ISACTIVE=TRUE)
> IF MPEXNUMSUCCEEDED> 0 THEN
> ECHO ***** DO SOMETHING TO LDEV HERE *****
> ENDIF
> FORNUM I=100,4679
>
> Of course, YES I could use a traditional method like performing a SHODEV PRINTER (becasue I assigned that class), and reading the $STDLIST into a file and cropping out the spaces to pic up each LDEV number. Then execute a script on each line of the edited file.
>
> However my mind was thinking in a serial mode this morning. Or it could be it is just too early.
>
> Tracy Johnson
> 00 1 757 766 4318 tel
> 00 1 757 755-6470 mobile
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|