ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Enabling user to end writer and vary off printer

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Enabling user to end writer and vary off printer

    b/c of some weird unknown reason. We have an HP printer that when it runs out of paper it needs varied off and back on. This user does not have authority to the device. How can I in a CL program allow them to do this? I have tried GRTACCAUT but that does not work. Gives me an error saying they are not authorized. Well I now that .. I'm trying to temporarily give access.
    Any ideas?
    Thanks

  • #2
    Write a little CL program that has the USRPRF(*OWNER) parameter specified when it's compiled and is owned by a user with sufficient authority to act on the device. If you're at the right OS release, you can specify the command DCLPRCOPT USRPRF(*OWNER) in the source so it will use that option on the compile without having to manually specify it.

    Comment


    • #3
      I just tried all that and get the same result.
      Not authorized to control writer 408337/QSPLJOB/PRT50.
      Device PRT50 vary processing stopped.

      Cl Program
      DCLPRCOPT USRPRF(*OWNER)
      ENDWTR WTR(PRT50) OPTION(*IMMED)
      MONMSG MSGID(CPF0000)
      VRYCFG CFGOBJ(PRT50) CFGTYPE(*DEV) STATUS(*OFF) +
      ASCVRYOFF(*YES) FRCVRYOFF(*YES)
      MONMSG MSGID(CPF0000)
      VRYCFG CFGOBJ(PRT50) CFGTYPE(*DEV) STATUS(*ON)
      MONMSG MSGID(CPF0000)
      STRPRTWTR DEV(PRT50)
      MONMSG MSGID(CPF0000)

      Comment


      • #4
        Use WRKOBJ to make sure it's owned by the user you're expecting it to be... then CHGPGM pgmname and prompt with F4 and make sure that USRPRF is set to *OWNER.

        If it's not owned by who you're expecting, use CHGOBJOWN - prompt it. Specify name of your program - object type of *PGM, specify desired owner for New Onwer and default the Current Owner authority.

        Comment


        • #5
          Also - make sure the profile used for owner has special authority of *SPLCTL

          Comment


          • #6
            That worked. Thanks

            Comment


            • #7
              I would try to determine why the printer needs to be varied off when it runs out of paper - that's just plain weird. You may find the following web site helpful in determining whether the printer is configured correctly - I'd be willing to bet that it's not.



              Cheers,

              Emmanuel

              Comment

              Working...
              X