|
You mean the commands ADDJOBSCDE, RMVJOBSCDE from QCMDEXC? Before you go that route, with a program not adopting authority, you might want to try ADDJOBSCDE with a normal user profile that would be running the program. I think it will have a problem with ADDJOBSCDE USER(POWERDUDE). What might work is leaving the entries out there ADDJOBSCDE SCDDATE(013105) SCDTIME(0100) SAVE(*YES) USER(POWERDUDE) HLDJOBSCDE And then just have your program do a CHGJOBSCDE SCDDATE(*CURRENT) SCDTIME(*CURRENT) followed by a RLSJOBSCDE. Then again, there are the profile handle api's which might be better. Haven't used them myself. Or, instead of having to remember how to compile the programs, you could invest in a Change Management system and use that. Or write your own 'precompiler' that would interpret funny comments in your program as compile commands. Been some discussion in the archives, and posted code on some website, on doing that. Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com "Hodder, Douglas" <DHodder@xxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 01/13/2005 05:55 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To "'RPG programming on the AS400 / iSeries'" <rpg400-l@xxxxxxxxxxxx> cc Subject RE: Schedule a job under different user profile Thanks Rob, I tried logging the CL program commands and discovered that the job was actually running fine. Just that the report was being sent to the wrong OUTQ. I have this working now, but, I'm not sure that it is a very good approach. Anytime PgmA is compiled now, I have to remember to change the owner to QSECOFR (as well as some other attributes listed previously). Anyone have any ideas on a better approach? Is there an API that can create and then remove a jobscde via RPG? Basically, I just need to submit a job (from within an RPG pgm) under someone elses user profile. Any suggestions would be appreciated. Thanks Doug -----Original Message----- From: rpg400-l-bounces@xxxxxxxxxxxx [mailto:rpg400-l-bounces@xxxxxxxxxxxx]On Behalf Of rob@xxxxxxxxx Sent: January 12, 2005 12:44 PM To: RPG programming on the AS400 / iSeries Subject: Re: Schedule a job under different user profile 1) After the call to QCMDEXC check your Program Status Data Structure DMYPSDS SDS ... D EXCP_MSG 40 46 D EXCP_TYPE 40 42 * Exception type D EXCP_NUM 43 46 * Exception number D PGM_LIB 81 90 * Program library D EXCP_DATA 91 170 * Exception data ... Any problems? 2) If no problems, then check your joblog. Should be a message like Job 048478/ROB/MYJOB submitted to job queue ... If so, then you should be able to do a WRKJOB 048478/ROB/MYJOB and find it's joblog. If you find nothing using WRKJOB, then do a DSPLOG JOB(048478/ROB/MYJOB) Job 048478/ROB/MYJOB started on 01/12/05 at 11:09:08 Job 048478/ROB/MYJOB ended on 01/12/05 at 11:09:08; If you have those, then either change your sbmjob LOG(4 0 *SECLVL) LOGCLPGM(*YES) or (what I recommend) change the job description associated with it (even if only temporarily until debugged) to LOG(4 0 *SECLVL) LOGCLPGM(*YES) Rob Berendt -- Group Dekko Services, LLC Dept 01.073 PO Box 2000 Dock 108 6928N 400E Kendallville, IN 46755 http://www.dekko.com "Hodder, Douglas" <DHodder@xxxxxxxx> Sent by: rpg400-l-bounces@xxxxxxxxxxxx 01/12/2005 07:03 AM Please respond to RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx> To "'rpg400-l@xxxxxxxxxxxx'" <rpg400-l@xxxxxxxxxxxx> cc Subject Schedule a job under different user profile Hi, I have a scenario where I am attempting to submit a job (from within an RPG pgm using QCMDEXC) under a specified user profile. The user profile comes from a table. Here's the flow. User#1 calls PgmA. >From within PgmA, PgmB is submitted (using QCMDEXC) under user profile User#2. Originally I got an error stating that User#1 does not have authority to User#2 profile and thus the job didnt submit. So, instead of messing around with the user profiles, I changed the attributes of PgmA to be Owner=QSECOFR, User Profile=*OWNER and Use Adopted Authority=*YES. I figured this would work. So now when it runs, the PgmA does not crash, but, PgmB never seems to get submitted. Anyone have any ideas on how to make this work? I may be way off base with my approach so any ideas would be appreciated. Thanks Doug Hodder MIS Department Fishery Products International (709) 570-0404 dhodder@xxxxxxxx -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l. -- This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxx To subscribe, unsubscribe, or change list options, visit: http://lists.midrange.com/mailman/listinfo/rpg400-l or email: RPG400-L-request@xxxxxxxxxxxx Before posting, please take a moment to review the archives at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.