ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Copy of WRKDIRE entry

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

  • Copy of WRKDIRE entry

    I've always found it annoying that there's not a 3=copy option from WRKDIRE. I have to make entries for almost 100 very similar users, and it would be great to specify a reference ID and new ID and have a copy come up where I can just make adjustments... So I'm thinking about writing one but thought I'd first check to see if anyone else had written one that they'd be willing to share...?

  • #2
    Re: Copy of WRKDIRE entry

    It's only once each year or two that I see anyone doing anything with the system directory nowadays. Should we assume that this is a rare or one-time task?

    If I was going to do something like what you seem to want to do, I'd probably generate a kind of "template" ADDDIRE command first. That might be done by prompting the CHGDIRE command over the user ID that you want to 'clone'. If you type over a character for any command parm, the command assumes that you are changing that parm value even if you type the same character.

    Once you've caused each desired parm to be selected by over-typing, press <F14>.

    The full CHGDIRE command string is shown to you, and you can copy/paste it into perhaps a CL source member. You can also type "ADD" over "CHG" and get a "template" ADDDIRE command with all parms that you might be interested in. It only takes a couple minutes start to finish to reach that point.

    From there, you'd probably need to assign CL variables to parms such as USRID(), USRD(), USER() and NETUSRID(). Those should be unique per user. I'm not sure how you'll get those values, but a temporary table seems reasonable.
    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


    • #3
      Re: Copy of WRKDIRE entry

      Yes, one-time... no WRKDIRE entries were ever added for these employee profiles so I need to get them in there along with the SMTP info. I'm doing it with a process very similar to what you've described, and I was able to get the user profiles isolated into a temporary file that I can use for this. Thanks!

      p.s. I figured I'd let the program add the SMTP address for me too, but my SQL statement came back with SQL0607 indicating that I can't add a record to system table QATMSMTP... I guess I need to do that part manually.
      Last edited by Viking; July 26, 2013, 02:49 PM.

      Comment


      • #4
        Re: Copy of WRKDIRE entry

        IIRC (and it's been many years so that's questionable), the ADDDIRE command should be able to include SMTP address as long as (1) the SMTPAUSRID (user ID) and SMTPDMN (domain) user-defined fields are listed in the USRDFNFLD() command parm and (2) the system directory is where you store SMTP addresses.

        You can tell whether or not SMTP addresses are part of the system directory by running the WRKNAMSMTP command. The command will either bring up a list or it will return a message telling you that it's been "disabled".

        Originally, SMTP addresses were held separately. Sometime after a couple OS upgrades, the capability of using the system directory for those addresses was added. The CVTNAMSMTP command would do a conversion from the original file(s) to system directory "user-defined fields".
        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

        Working...
        X