Device Printers
420 pts.
0
Q:
Device Printers
Hi friends, How can I create a CL to Start or End a printer device ?
A command or CL like this:

Start or End Printer Y or E ____ Option
Name of the device printer ____ *devd

Thanks for all.
ASKED: May 14 2008  8:38 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
4885 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
You would write a CL program which, when &Start = 'Y' issues a STRPRTWTR command or if 'E' issues the ENDWTR command. If you felt up to it, you could also use APIs to find, and prompt the user, with a list of valid printer devices rather than making them type in/remember the device name.
Last Answered: May 15 2008  10:41 AM GMT by Bvining   4885 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

SILVARB   420 pts.  |   May 15 2008  12:57AM GMT

Below, the CL (not works)

PGM PARM(&DEV)
DCL VAR(&DEV) TYPE(*CHAR) LEN(10)
DCL VAR(&MESAGE) TYPE(*CHAR) LEN(80)
CHKOBJ OBJ(QSYS/&DEV) OBJTYPE(*DEVD)
MONMSG MSGID(CPF9801) EXEC(DO)
CHGVAR VAR(&MESAGE) VALUE(’Impressora ‘ *CAT &DEV +
*BCAT ‘Nao existe, Confirme o nome da +
Impressora’)
GOTO CMDLBL(END)
ENDDO
WRKCFGSTS CFGTYPE(*DEV) CFGD(&DEV)
GOTO CMDLBL(END)
END: ENDPGM

 

WoodEngineer   2280 pts.  |   May 15 2008  4:05PM GMT

Asking the user to remember system printer names can be a challenge. We wrote a command using the special value feature which allows the user to enter “AcctPrinter”, “Marys Prt”, etc. The replacement value sends the system name to the command processing program. The system allows 300 replacement values to be coded for a command parm which is probably enough for most.

 
0