a été mise à jour le
02 octobre 2009.
last version : How to upload to my 400
CHGPFM FILE(QPGMSRC) MBR(WRKJOBFM ) SRCTYPE(DSPF ) EXPDATE(*NONE) SHARE(*NO) TEXT('work with jobs, improved ')
CHGPFM FILE(QPGMSRC) MBR(WRKJOBR ) SRCTYPE(SQLRPGLE ) EXPDATE(*NONE) SHARE(*NO) TEXT('work with jobs, improved ')
CHGPFM FILE(QPGMSRC) MBR(WRKJOBS ) SRCTYPE(CMD ) EXPDATE(*NONE) SHARE(*NO) TEXT('work with jobs, improved ')
CHGPFM FILE(QPGMSRC) MBR(WRKJOBHP ) SRCTYPE(PNLGRP ) EXPDATE(*NONE) SHARE(*NO) TEXT('work with jobs, improved ')
CRTPNLGRP PNLGRP(WRKJOBHP) SRCFILE(QPGMSRC)
CRTDSPF FILE(WRKJOBFM) SRCFILE(QPGMSRC) SRCMBR(WRKJOBFM) RSTDSP(*YES) REPLACE(*YES)
CRTSQLRPGI OBJ(WRKJOBR) SRCFILE(JPLTOOLS) OBJTYPE(*MODULE) OPTION(*NOSEQSRC *XREF *SECLVL) DBGVIEW(*SOURCE) TGTRLS(V5R3M0)
CRTPGM PGM(WRKJOBR) BNDDIR(QC2LE) ACTGRP(JPLTOOLS) TGTRLS(V5R3M0)
CRTCMD CMD(WRKJOBS) PGM(*LIBL/WRKJOBR) SRCFILE(QPGMSRC) SRCMBR(WRKJOBS) REPLACE(*YES)
list of dormant program, for option 50
CHGPFM FILE(JPLTOOLS) MBR(SLPPGM) SRCTYPE(CMD) TEXT('List of sleeping programs') EXPDATE(*NONE) SHARE(*NO)
CHGPFM FILE(JPLTOOLS) MBR(SLPPGMFM) SRCTYPE(DSPF) TEXT('List of sleeping programs') EXPDATE(*NONE) SHARE(*NO)
CHGPFM FILE(JPLTOOLS) MBR(SLPPGMR) SRCTYPE(RPGLE) TEXT('List of sleeping programs') EXPDATE(*NONE) SHARE(*NO)
CRTCMD CMD(SLPPGM) PGM(SLPPGMR) SRCFILE(JPLTOOLS)
CRTDSPF FILE(SLPPGMFM) SRCFILE(JPLTOOLS) RSTDSP(*YES)
CRTRPGMOD MODULE(SLPPGMR) SRCFILE(JPLTOOLS) OPTION(*NODEBUGIO *SRCSTMT *SHOWCPY *SECLVL *EXPDDS)
DBGVIEW(*ALL) REPLACE(*YES) TGTRLS(V5R3M0) ENBPFRCOL(*FULL)
CRTPGM PGM(SLPPGMR) BNDDIR(QC2LE JPLTOOLS) ACTGRP(*NEW) OPTION(*DUPPROC) TGTRLS(V5R3M0)
Screen shows first with *ALL but Jobname = QZDA* : first usage is to work with ODBC jobs.
The first 3 filter fields are for calling the API, they are wilcards values (IE terminated with a *). A * is added at end if missing
The next fields are masks for filtering when reading list of jobs : do not need to add a * at end. A * at end is removed if any.
For all fields, *BLANK = *ALL = *. So, just clear a filter-field witch is not in the filter target.
To sort a column, let the cursor on the column then press F16, such as in WRKACTJOB
WRKJOBR B 19/01/07 18:54:11 M170PUB1 JPLTOOLS jp jpltools 195 Lines
wrkjobr is based on well known apis QUS*US, QUSLJOB and QUSRJOBI. OK, no gold here. But I have discover a pretty way when using the user space. After loading the user space, I have declared it as ... a working variable. How ? With a pointer ! The blending of user space and pointer produce a code very clear. code excerpt :
start with creating a user space in qtemp (no secret)
quscrtus ( Usrspc// get memory for array .../...
then, call the list job API : (no more secret)
qusljob(usrspc : 'JOBL0100' : qjob : cbstatus :errcode )
now, I have a based data structure named LAH (for List Api
Header). (it's here the sorcerer had
I give to the pointer the address of the user space. Clearly, I use LAH as a mask to format & read the user space
qusptrus(usrspc : pLAH);
And Voila ! my LAH work field is now "containing" the user
data : under STRDBG, i can run EVAL LAH
Now, I can use the list as if it is in an array (in fact, it's really an array)
for iJob= 0 to lah.count - 1;
Applause the guru ! (yes i'm very proud of myself. it's not politically correct, but when I am alone in front of my mirror, no one comes to antagonize me, even my reflection, it's to say!)
it's not the end ! there is an other nugget
I have implemented the "F16=sort" with the C-Sort-Array procedure :
For details search the web about QSORT, there are many
articles on (first
target : SystemINews)
But, to resume, QSORT need
Below, SortArray is the array, and SortBy is the function that sorts 2 elements
some data definitions
// Prototype for qsort - which should be in a /COPY member
how to load an element :
// add an element to sort array
how to sort the elements
SortBy = %Paddr(SortBySbsJob);
how to unload elements
SortAryPos = 1;
And the call-back sort procedure for one element :
P SortBySbsJob b
RPGLE + C runtime library, the dream team !
The source code is provided as an open source tool under the GNU General Public License, version 2. In summary, this license specifies:
By clicking the download link you acknowledge and agree to the terms of the license.
Download the (zipped) SAVF containing the JPLTOOLS : the source file, the message file, the bnddir
THIS TOOLBOX IS PROVIDED ''AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE PROVIDER OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS TOOLBOX, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.