Authority to run a job to delete libraries and also sending spool files via email

20 pts.
Tags:
AS/400
Hi...could anyone please provide some guidance on the following:- I have been tasked with deleting libraries on our devlopment machine. I have used s DSPOBJD in my CL and specified QSYS in the library parameter to pick up all the libraries on the subsystem which are prefixed with certain letters i.e. 'TES* etc......and specify the output to go to an outtfile in QTEMP.. I then have an RPG to read the outfile and depending upon certain criteria..if it's been saved to tape being one of these I then delete it using QCMDEXC. How do I need  to consider being authorised to delete these libraries or is just a matter of ensuring that this job is run using a jobd/user profile etc.  which gives me the correct priveleges to delete any library ..would I need to change the authorities  to each library before I delete this? My second question is that this job produces some reports which I need to send to an email account as a PDF file...is there a way to do this?     

Software/Hardware used:
i-series

Answer Wiki

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

If your profile does not have the proper authorities, then I would suggest you run the program with one that does.

As far as the reports go, you can look into one of the several email programs, both free and commercial, that are available for the iSeries. MMAIL and RPGMAL are two of the free ones that come to mind. I think MMAIL even has a spool file to PDF converter.

There are a host of commercial email programs out there also. The one that we use is MAILTOOL and MAILTOOL Plus by Brad Stone.

_______________________

You could chgobjown of your program to a user that has sufficient authority to delete the libraies. Then chgpgm to usrprf (*owner) useadpaut(*yes) so the program will use the owners authority regardless of the user who submits the program. I would recommend public(*exclude) for your program and add authorized users individually.

IBM’s Infoprint Server for iSeries (5722-IP1) enables the production of Adobe Portable Document Format (PDF) files from any iSeries output.

================================================

Note that USEADPAUT(*YES) is unnecessary if USRPRF(*OWNER) is supplying desired adopted authority. USEADPAUT(*YES) would only be needed if the program required adopted authority from higher in the call stack. And since USEADPAUT(*YES) is the standard default anyway, it’s usually discussed in terms of USEADPAUT(*NO) where the intention is to <i>block</i> adopted authority from propagating into <i>and through</i> this program, potentially down to even lower call-stack levels.

Tom

Discuss This Question: 4  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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Djb
    Many thanks Tom...I'll look further at how we need to run this...you're idea for the chgobjown etc. seems a good one...do you think that the DSPOBJD would be the best way for me to know that I have picked up all the libraries that I need?...
    20 pointsBadges:
    report
  • wpoulin
    Nobody's mentioned that you can use CPYSPLF, CPYTOPCD, and SNDDST to convert your spool file to a PDF and send it as an email attachment. All native commands in OS/400, available at no cost. Hope this helps, Bill
    2,480 pointsBadges:
    report
  • TomLiotta
    Note that the CHGOBJOWN suggestion was supplied by Whatis23. I only added the refinement on the use of USEADAPAUT(). Tom
    125,585 pointsBadges:
    report
  • TomLiotta
    …do you think that the DSPOBJD would be the best way for me to know that I have picked up all the libraries that I need? If you aren't authorized to a library, it shouldn't be included in the list of libraries that DSPOBJD will create. It's probably the best way for you to do it for now. Better ways will be available after you have some experience with how this works for you. Tom
    125,585 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.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

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

Following