Using IBM i? Need to create Excel, CSV, HTML, JSON, PDF, SPOOL reports? Learn more about the fastest and least expensive tool for the job: SQL iQuery.
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...?
There's always the CPY command that will copy an IFS file to another location or another name. And since you have to do about 100 of them: easy to use in a CL too!
I don't need to copy any IFS files... I just need to set up a bunch of almost identical WRKDIRE entries.
I usually use F9 on a full empty screen (Call qcmd > F11) so I can modify the new one.
Not perfect but beats rekeying it all.
Viking, I don't know if I'm on the right path here but, have you looked at the QOKSCHD API?
DSPDIRE of the entry you want to "copy" to a file, read the file in your program, then use ADDDIRE 100 very similar times. I'll hazard a guess that DSPDIRE is easier to use than QOKSCHD, but I'll leave that determination up to you
I was able to isolate the user profiles in a work file and then my CL does a ADDDIRE for each one with all the common info. Incidentally, I tried having it add the SMTP info too (since for these user profiles the email address follows a pattern and the DOMROUTE is always the same) but got SQL0607 indicating that I can't update system table QATMSMTP... so I guess I need to do that part manually.
I will take a look at QOKSCHD for my edification, but thankfully this is a one-time thing that I'll have to do this many at once. Users had been being set up without this info being added, so hopefully now they'll add them as they create new user profiles.
Thanks for your input!