ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Pulling Device Description Info - Needing Print Device Info

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

  • Pulling Device Description Info - Needing Print Device Info

    Good afternoon,

    I'm looking for kind assistance from the AS400 admin gods out there.

    I would like to pull all device descriptions (Workstation IDs mainly) in the system and hone in on just the "print device" & "output queue" fields to see what they're all mapped to for auditing purposes.

    Reason being is because there's a rogue job log that keeps printing out hundreds of pages in system. We don't have spool file auditing either. I figure it would be nice to see what printer devices are mapped to each Workstation ID in our system. Then do a ctl+F, or use find function on the generated spool file report for example.

    For now I've created a new writer in AS400 and I've Held the old writer. That way I can catch anything before it prints. I would appreciate a push in the right direction, or maybe help me rethink the issue. Even IBM support from our side was lost sadly. They simply advised us to do a SQL report. One can only do a "dspdevd ##" command, and choose 6=Print, but that's only for one device desc at a time.

    I'm learning the ropes still, so I'm starting to read the CL Redbooks from IBM from scratch! Thanks.

  • #2
    Re: Pulling Device Description Info - Needing Print Device Info

    DSPOBJD to an *OutFile, then you can SQL the table to find
    Hunting down the future ms. Ex DeadManWalks. *certain restrictions apply

    Comment


    • #3
      Re: Pulling Device Description Info - Needing Print Device Info

      Originally posted by LiQuiD_FuSioN
      ...there's a rogue job log that keeps printing out hundreds of pages in system.
      What does the joblog have to do with the question? That is, if you have the joblog, you should already have everything needed to determine any associated device.

      Most device commands work on individual devices. You'll end up with individual spooled files for each device and need to scan them individually. I suppose it might be possible to OVRPRTF to share the spooled file and capture them all at once. But it's not clear what you actually want to accomplish.

      I would use APIs to select and list device descriptions, then extract any wanted data from there. It doesn't sound like you're prepared to do it that way, though.

      As an alternative, you might work through PDM.

      Create a new source file, e.g., MYLIB/DEVSRC. Then create a PDM user option. Give it an ID like "RD" and use something like this for the command:
      Code:
      RTVCFGSRC CFGD(&N) CFGTYPE(*DEVD) SRCFILE(MYLIB/DEVSRC) RTVOPT(*OBJ)
      You can then run this:
      Code:
      WRKOBJPDM LIB(QSYS) OBJTYPE(*DEVD) OBJATR(DSP*)
      That should list all local and virtual display devices. Set user option RD in the first one and press F13 to duplicate the option to the end of the list. Press -Enter-.

      The CL source for RTVCFGSRC will be extracted into members. You can then use PDM to scan the source for whatever PRTDEV() or OUTQ() values your interested in.

      With some variation, you could change the RTVCFGSRC user option to specify a single named source member and MBROPT(*ADD). That would put all of them into a single named member rather than a series of members. You might even run the process both ways so that you'll have it both ways.

      But it might be best if you could clarify just what it is that you need to accomplish. What is your objective and why doesn't the joblog provide what you need?
      Tom

      There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

      Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

      Comment


      • #4
        Re: Pulling Device Description Info - Needing Print Device Info

        Copied from Private Message from LiQuiD_FuSioN:

        Originally posted by LiQuiD_FuSioN
        I'm not allowed to reply for some reason.

        In regards to:


        The job log that prints out has no other details. No job num, profile name or Workstation ID. Believe me if I saw that info that would squelch that printing issue easily.

        Now that you mention it, perhaps I'm not using the term job log appropriately. It's paperwork showing changes made to some records. There's also a query that prints out, I may ask our programmers if there's any other way to input the workstation ID on it. Otherwise I'll give your kind suggestion a try. Thanks again!
        Ah, makes more sense. Yeah, that'd be some kind of audit log. Does it print automatically? Does it finish printing too quickly to see it in the *OUTQ?
        Tom

        There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

        Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

        Comment


        • #5
          Re: Pulling Device Description Info - Needing Print Device Info

          Originally posted by tomliotta View Post
          What does the joblog have to do with the question? That is, if you have the joblog, you should already have everything needed to determine any associated device.

          Most device commands work on individual devices. You'll end up with individual spooled files for each device and need to scan them individually. I suppose it might be possible to OVRPRTF to share the spooled file and capture them all at once. But it's not clear what you actually want to accomplish.

          I would use APIs to select and list device descriptions, then extract any wanted data from there. It doesn't sound like you're prepared to do it that way, though.

          As an alternative, you might work through PDM.

          Create a new source file, e.g., MYLIB/DEVSRC. Then create a PDM user option. Give it an ID like "RD" and use something like this for the command:
          Code:
          RTVCFGSRC CFGD(&N) CFGTYPE(*DEVD) SRCFILE(MYLIB/DEVSRC) RTVOPT(*OBJ)
          You can then run this:
          Code:
          WRKOBJPDM LIB(QSYS) OBJTYPE(*DEVD) OBJATR(DSP*)
          That should list all local and virtual display devices. Set user option RD in the first one and press F13 to duplicate the option to the end of the list. Press -Enter-.

          The CL source for RTVCFGSRC will be extracted into members. You can then use PDM to scan the source for whatever PRTDEV() or OUTQ() values your interested in.

          With some variation, you could change the RTVCFGSRC user option to specify a single named source member and MBROPT(*ADD). That would put all of them into a single named member rather than a series of members. You might even run the process both ways so that you'll have it both ways.

          But it might be best if you could clarify just what it is that you need to accomplish. What is your objective and why doesn't the joblog provide what you need?
          You rock!! This pulled the data I needed. Thank you!

          I don't even mind that it pulled everything about each device. I can look up IP addresses, print device names for example. This is great.

          The only thing I did differently (I was weary, and testing) was use the RD option just ONCE for one workstation ID. It ended up pulling all devices for some reason.

          Comment


          • #6
            Re: Pulling Device Description Info - Needing Print Device Info

            Originally posted by LiQuiD_FuSioN View Post
            You rock!! This pulled the data I needed. Thank you!

            I don't even mind that it pulled everything about each device. I can look up IP addresses, print device names for example. This is great.

            The only thing I did differently (I was weary, and testing) was use the RD option just ONCE for one workstation ID. It ended up pulling all devices for some reason.
            I know this thread is old, but JUST for future reference and for others out there wondering: After using "RTVCFGSRC" command with PDM (earlier in thread) I simply use "dsppfm" on the file that gets generated and use "Find" (F16) to locate the text or device ID I need.

            I really like having the file in my test library, it comes in handy during times where someone says they were printing fine one day and then not the next. I have proof or evidence to show what the user was configured to before.

            Comment


            • #7
              Re: Pulling Device Description Info - Needing Print Device Info

              Originally posted by LiQuiD_FuSioN View Post
              I know this thread is old
              I appreciate it when people update old threads. Someone may come across this thread some day while googling and the update will be helpful. Who knows? I may be that someone.

              Comment


              • DaleJanus
                DaleJanus commented
                Editing a comment
                someone HAS come accross this thread while googling and finds it very helpful. Now I have a way to search for IP addresses of printers. Thanks.
            Working...
            X