AS/400 user profile default printer

2550 pts.
Tags:
AS/400
Is there a way I can have a program get the User's default printer from the User Profile? I want to let them run a STRWTR but lock them into just that one printer. Yes, most of our printers are named the same as their normal outqs. I can get the user profile from the system data structure but I don't know where to go for the printer/outq (or if this is even possible).


Software/Hardware used:
as400
1

Answer Wiki

Thanks. We'll let you know when a new response is added.

Each user profile has a default OUTQ and a default printer device (probably *WRKSTN). You will need to get the name of the current user profile and use RTVUSRPRF to fetch either the device or the OUTQ or both, then start the appropriate writer.

Discuss This Question: 10  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.
  • aceofdelts

    OK - I found that I can get the value via RTVJOBA and RTVUSRPRF

    Of course, I'm always looking for a better idea if you have one.

    2,550 pointsBadges:
    report
  • ToddN2000
    Like aceofdelts said, those are the 2 easiest ways to do it. Another possible option would be via a custom user menu option.
    132,590 pointsBadges:
    report
  • aceofdelts

    We had a not-very-fancy custom option that would prompt for the Writer name to be started (or ended). This became problematic when users figured out they could start/end ALL writers. So we took away the ENDWTR option completely (in theory they can power off the device which should end the writer). For now, we made it so they can start only the writer in their user profile with no other options (and no messages - likely would just confuse them). We still need to figure out a better way to handle "area" printers such as label printers ... not tied to any UserID and need the STRRMTWTR command.

    Any ideas on this ?

    Keeping it simple is a high priority - both usage and maintenance. We add new printers often. We run 24/7 in the plants but not in IT.

    2,550 pointsBadges:
    report
  • azohawk

    One potential way is a file that lists user names and the printers they are allowed to manage. The user selects an option that presents them with a list (subfile) of printers they are permitted to manage and they select a printer and the program will execute a restart on that printer. The program will need to be able to determine which commands to use (such as STRRMTWTR vs STRWTR).

    Of course, someone will need to manage the file, which may include Terry has moved from DeptA to DeptB and no longer needs access to DeptA printers, but does need access to DeptB printers, Vince has left the company, Sandy has joined the company, we added a printer and everyone in DeptC needs to be able to manage it, etc. Depending on the frequency of such changes this could take a lot of time.

    In terms of off-hour support, places I have worked in the past we had an on-call cell phone that we rotated. We also had access from home via computer to manage some of these things. One place we each were given a laptop that we typically left at home but we had propritory apps that we couldn't load on our personal equipment.

    I do find it interesting that you are adding printers when many companies are trying to reduce printers.

    4,055 pointsBadges:
    report
  • WoodEngineer
    Keep in mind that RTVJOBA returns the job's OUTQ which can be different from RTVUSRPRF's OUTQ. They are often the same but not always.
    8,225 pointsBadges:
    report
  • Splat
    We use a combination of the system reply list to end the writers whenever a problem kicks up- we do a lot of single page printing & taking an 'R' can cause the spool file to be lost if the printer's not working correctly - and a job that runs every 30 minutes to issue a STRPRTWTR for any PRTLAN or PRTvRT device (determined via the QUSLOBJ API) and a STRRMTWTR  OUTQ(*ALL) for any remote output queues.
    12,875 pointsBadges:
    report
  • GregManzo
    Last job I was in we had the IPL start all print writers (QSTRPRTWTR  Start print writers at IPL). Lets face it, why would you NOT want a print writer active?
    2,960 pointsBadges:
    report
  • aceofdelts
    Thanks for the ideas. Some good stuff here. Adding printers is mostly due to our "growth by acquisition" scheme.
    2,550 pointsBadges:
    report
  • ToddN2000
    It can be done a number of ways as some of us have mentioned. It can be done at multiple levels, some system settings and others by coding. If we knew just what you are trying to control we can steer you in the right direction. Are you looking to direct any one or combination of interactive jobs, batch jobs, screen prints on anything generated by this user to one printer? It may mean changing a user profile, JOBD or many programs.
    132,590 pointsBadges:
    report
  • azohawk
    I will add that in many cases when my users are having an issue with a printer, the writer is still active. I find that just ending and restarting the writer does the trick. You indicated that you don't want users ending the writer, but sometimes it is needed as you cannot start a started writer.
    4,055 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

Thanks! We'll email you when relevant content is added and updated.

Following

Share this item with your network: