Midrange News for the IBM i Community


Posted by: Viking
Information Systems
CA
Copy WRKDIRE entry
has no ratings.
Published: 25 Jul 2013
Revised: 26 Jul 2013 - 3925 days ago
Last viewed on: 23 Apr 2024 (6124 views) 

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.

Copy WRKDIRE entry Published by: Viking on 25 Jul 2013 view comments(6)

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...?

Return to midrangenews.com home page.
Sort Ascend | Descend

COMMENTS

(Sign in to Post a Comment)
Posted by: Paulster
Premium member *
Sweden and The Netherlands
Comment on: Copy WRKDIRE entry
Posted: 10 years 9 months 2 hours 57 minutes ago
Edited: Thu, 25 Jul, 2013 at 23:43:32 (3926 days ago)

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!

Posted by: Viking
Premium member *
CA
Comment on: Copy WRKDIRE entry
Posted: 10 years 8 months 29 days 15 hours 2 minutes ago

I don't need to copy any IFS files... I just need to set up a bunch of almost identical WRKDIRE entries.

Posted by: DannyFromOP
Premium member *
Comment on: Copy WRKDIRE entry
Posted: 10 years 8 months 29 days 14 hours 22 minutes ago

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.

Posted by: bobcozzi
Site Admin ****
Chicagoland
Comment on: Copy WRKDIRE entry
Posted: 10 years 8 months 29 days 14 hours 17 minutes ago

Viking, I don't know if I'm on the right path here but, have you looked at the QOKSCHD API?

Posted by: DaleB
Premium member *
Reading, PA
Comment on: Copy WRKDIRE entry
Posted: 10 years 8 months 29 days 12 hours 24 minutes ago
Edited: Fri, 26 Jul, 2013 at 14:16:26 (3925 days ago)

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 

Posted by: Viking
Premium member *
CA
Comment on: Copy WRKDIRE entry
Posted: 10 years 8 months 29 days 10 hours 38 minutes ago

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!