$! UNSOLICITED-PJL-FIX.COM $! Paul Anderson 13-Apr-1998 $! $! Creates device control modules in alternate library to fix problem with $! unsolicited PJL messages $ $! This command procedure is provided as an example. $! It should work as supplied but should be used with caution. $ $ set noon $ set symbol /scope=(noglobal,nolocal) $ on control_y then goto exit $ old_privileges = f$setprv ("bypass") $ $ type sys$input This procedure fixes problems with printers receiving unsolicited PJL messages and interfering with DCPS print jobs. You should choose to modify only those PCL printers that are experiencing DCPS problems due to unsolicited PJL messages. The DCPS device control library, SYS$LIBRARY:DCPS$DEVCTL.TLB, will be modified. You will be asked if you want to make a backup copy of the library before changes are made. The modified library will be overwritten the next time DCPS is installed on your system. If the PJL problem is not fixed by that release of DCPS, you will need to reapply these changes. You must stop and restart all DCPS queues for the printer(s) you change for the modifications to take effect. This command procedure is provided as an example. It should work as supplied but should be used with caution. $ read /prompt="Do you want to continue? [YES] " sys$command yn $ if yn .eqs. "" then yn = "Y" $ if .not. yn then goto exit $ library_to_change = "SYS$LIBRARY:DCPS$DEVCTL" $ prompt = "Do you want to make a backup copy of DCPS$DEVCTL.TLB? [YES] " $ $ prompt_backup: $ read /prompt="''prompt'" sys$command yn $ if yn .eqs. "" then yn = "Y" $ if yn then copy /log 'library_to_change'.tlb sys$library:.tlb_before-pjl $ gosub create_pjl_code $ $ library /list=dcps-pjl-fix /text 'library_to_change' $ search /output=dcps-pjl-fix.txt dcps-pjl-fix.lis - lps$$,initpsdevice /match=and $ i = 0 $ write sys$output "" $ open file_lib dcps-pjl-fix.txt $ $ read: $ read /end_of_file=eof file_lib record $ i = i + 1 $ printer_name_'i' = f$extract (5, 80, f$element (0, "_", record)) $ if i .lt. 10 $ then i_string = " " + f$string (i) $ else i_string = f$string (i) $ endif $ write sys$output " ", i_string, " ", printer_name_'i' $ goto read $ $ eof: $ close file_lib $ number_of_printers = i $ $ prompt_printer: $ write sys$output "" $ read /prompt="Enter number of printer to modify: " sys$command choice $ if choice .le. 0 .or. choice .gt. number_of_printers $ then write sys$output "Please choose a number between 1 and ", - number_of_printers $ goto prompt_printer $ endif $ module_name = "LPS$$" + printer_name_'choice' + "_INITPSDEVICE" $ write sys$output "" $ library /extract='module_name' /log /output='module_name'.ps /text - 'library_to_change' $ gosub check_pjl $ if .not. make_changes then goto exit $ copy dcps-pjl-fix.ps,'module_name'.ps 'module_name'.new $ write sys$output "" $ library /log /replace /text 'library_to_change' 'module_name'.new $ type sys$input The DCPS device control library has been modified for $ write sys$output " printers of type ", printer_name_'choice', "." $ type sys$input You must now stop and restart all DCPS execution queues that print to such printers for the changes to take effect. $ $ exit: $ close /nolog file_lib $ close /nolog file_pjl $ old_privileges = f$setprv (old_privileges) $ if f$search ("dcps-pjl-fix.*") .nes. "" - then delete dcps-pjl-fix.*;* /exclude=dcps-pjl-fix.com $ exit $ $ check_pjl: $ define /user_mode sys$error nl: $ define /user_mode sys$output nl: $ search /nooutput 'module_name'.ps "@PJL USTATUSOFF" $ if $severity .eqs. "1" $ then make_changes = "N" $ write sys$output "" $ write sys$output " The module for ", - printer_name_'choice', " has already ", - "been changed." $ write sys$output " No changes have been made." $ write sys$output "" $ else make_changes = "Y" $ endif $ return $ $ create_pjl_code: $ esc[0,7] = 27 $ create dcps-pjl-fix.ps $ open /append file_pjl dcps-pjl-fix.ps $ write file_pjl esc, "%-12345X@PJL" $ write file_pjl "@PJL USTATUS DEVICE OFF" $ write file_pjl "@PJL USTATUSOFF" $ write file_pjl "@PJL Enter Language = PostScript" $ write file_pjl "%!" $ close file_pjl $ return