Question

  Asked: May 14 2008   8:38 PM GMT
  Asked by: SILVARB


Device Printers


AS/400 printing, CL

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.

Subscribe to Alerts! Get questions and answers delivered to your Inbox.


E-mail me updates on this question



   SUBSCRIBE

hidden modal window

Answer Wiki (Improve, edit or add to this answer)


 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0



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.
  • AddThis Social Bookmark Button

Browse more Questions and Answers on AS/400.

Looking for relevant AS/400 Whitepapers? Visit the Search400.com Research Library.


Discuss This Answer


You must be logged-in to discuss a question. Log-in/Register

SILVARB  |   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  |   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.