21
Sat, Dec
3 New Articles

The Find Job Descriptions with Objects Utility

APIs
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

Brief: Before you delete a library or other objects that may be used by your job descriptions, wait. Your job descriptions may not work properly after you perform the deletion. Quickly determine the job descriptions that reference a library or other objects with the utility contained in this article.

Using the initial library list of a job description is an efficient way to make sure a job has the appropriate libraries available to it. However, these job description library lists can cause you problems if someone deletes or renames any library in the list. For example, let's say you rename a library from APLIB to AP_LIB and you don't change the library name in the initial library list of all the job descriptions that contain it. If the job description of your user profile references one of these job descriptions, you won't be able to sign on. You will receive message CPF1113, "Library in initial library list not found." The error, of course, is the fact that a library in the library list no longer exists.

OS/400 does not prevent you from deleting a library used in a job description initial library list. Not only that, but there is no cross-reference tool available to locate job descriptions that reference a given library. You are left to listing your job descriptions and searching for library references manually.

There are also some other objects besides libraries (job queue, output queue, user and printer device) you may want to look for in job descriptions. Again, you'll find no tool to locate these objects used by job descriptions.

So, this month we give you a command called Find Job Description with Objects (FNDJOBDOBJ). The command lists any job descriptions that contain references to the objects you specify. It uses several application program interface (API) functions to retrieve the information it needs from the system; therefore, it runs very quickly. Because it uses the APIs, chances are it won't need modifications in the future to accommodate changes in OS/400.

Even if you decide you don't need this command, don't overlook the How It Works section of this article. From that section, you'll find out how easy it is to use APIs to get information from your AS/400.

The FNDJOBDOBJ Command

FNDJOBDOBJ displays or prints all job descriptions that contain a given library in their initial library list or as the library qualifier for the job queue or output queue of the job description. It will also list other objects used by job descriptions. The objects that can be referenced in a job description can be found by displaying the job description with the DSPJOBD command as illustrated in 1 (the objects are highlighted). The objects are (in the order presented in 1) user profile, job queue, job queue library, printer device, output queue, output queue library and the libraries in the initial library list.

FNDJOBDOBJ displays or prints all job descriptions that contain a given library in their initial library list or as the library qualifier for the job queue or output queue of the job description. It will also list other objects used by job descriptions. The objects that can be referenced in a job description can be found by displaying the job description with the DSPJOBD command as illustrated in Figure 1 (the objects are highlighted). The objects are (in the order presented in Figure 1) user profile, job queue, job queue library, printer device, output queue, output queue library and the libraries in the initial library list.

These objects may be of concern to you for various reasons. In general, deleting any of the objects without removing them from the job description references may cause jobs that use the job description to fail. Even if they don't, you shouldn't have obsolete objects referenced anywhere in your system if you can help it.

2 illustrates the FNDJOBDOBJ command prompt. It uses six parameters:

Figure 2 illustrates the FNDJOBDOBJ command prompt. It uses six parameters:

JOBD

Here you specify a job description, a generic job description or all job descriptions qualified by a library. The possible library values and their meanings are:

*ALLUSR: all user-defined libraries, plus libraries containing user data and having names starting with Q.

*ALL: all libraries.

*CURLIB: the job's current library.

*LIBL: the library list.

*USRLIBL: the user portion of the job's library list.

The possible job description values are:

*ALL: all job descriptions found in library (or libraries) specified are searched for specified objects.

job_description_name: the job description name.

The next five parameters are used to specify any combination of object types for which you may wish to search. At least one must be specified. If any of the objects you indicate are referenced in the job description, it will be listed.

LIB

*NONE: no search on library is done.

library_name: search the job description for this library in the initial library list, the job queue library or the output queue library.

JOBQ

*NONE: no search on job queue is done.

job_queue_name: search the job description for this job queue.

OUTQ

*NONE: no search on output queue is done.

output_queue_name: search the job description for this output queue.

USER

*NONE: no search on user is done.

user: search the job description for this user.

PRTDEV

*NONE: no search on printer device is done.

printer_device: search the job description for this printer device.

OUTPUT

The last parameter allows you to output to the display or printer. The display output is nothing more than the display of the spool file that is created. A better design would be using a subfile for the display output, but for brevity I chose this easier method.

* : output list to display.

*PRINT: output list to printer.

The user profile of a job description may be of special interest to those of you who insist on tight security. If a job description with a user profile value has public authority, any user on the system may submit a batch job using the job description and operate as the user profile in the job description.

My FNDJOBDOBJ command can be used to locate job descriptions that contain a specific user profile, but you can only search for one at a time. To list all job descriptions that contain any user profile, consider using the Check Job Description with User (CHKJOBDUSR) command in QUSRTOOL library. It will list any job descriptions that contain a user profile other than the default of *RQD.

3 contains a sample of the output created by the FNDJOBDOBJ command. There is a column for each type of object referenced in the job descriptions except for library objects found in the initial library list. In this case, the column to the right of the job description text with the INLLIBL heading will contain a Y or an N. The Y indicates that the library you are searching for exists in the initial library list of the job description; the N means it doesn't.

Figure 3 contains a sample of the output created by the FNDJOBDOBJ command. There is a column for each type of object referenced in the job descriptions except for library objects found in the initial library list. In this case, the column to the right of the job description text with the INLLIBL heading will contain a Y or an N. The Y indicates that the library you are searching for exists in the initial library list of the job description; the N means it doesn't.

To install this utility, key and compile the source members listed in Figures 4-7 using the compile instructions provided at the beginning of each source member.

How It Works

This section should particularly interest those of you who want to know how the APIs work. However, I encourage everyone to read this section to find out just how easy APIs can be to work with. This particular example is probably one of the simplest uses of APIs I have seen. Therefore, it serves as a clear illustration of how the interface operates.

The FNDJOBDOBJ utility could have been written more easily without the APIs. In fact, I initially created a stripped down version that didn't use APIs at all. However, if you really want to write software for the AS/400 that can accommodate possible changes to the operating system and therefore have a longer life span, you should use the APIs. IBM intentions are to keep existing APIs compatible with future releases. The following methods will be used to help ensure compatability when APIs change:

o If additional input or output parameters are required, they will be placed after the current ones.

o If an additional data structure is needed, a new format will be created.

o New information may be added to the end of an existing format.

You will also need to program your interface to the APIs to accommodate future change (see the System Programmer's Interface Reference manual for guidelines).

The command processing program (JOBD001CL, in 5) for the FNDJOBDOBJ command starts by checking to make sure at least one object name was submitted by the user. If none were submitted, the program sends an escape message.

The command processing program (JOBD001CL, in Figure 5) for the FNDJOBDOBJ command starts by checking to make sure at least one object name was submitted by the user. If none were submitted, the program sends an escape message.

Many of the APIs that provide information about objects (classified as List Object APIs) require a user space to contain the information the API generates. In this case, I use an API that requires a user space to get a list of job description objects. (See "Beyond CPYSPLF-Saving Everything in a Spooled File," MC, October 1993.)

Therefore, JOBD001CL creates a user space, JOBD001US-it actually calls an API program (QUSCRTUS) to create it. The APIs will extend a user space as needed, but it's better to make the space large enough so extending it is not necessary. In this case, I started with a size of 1024 bytes and ran the utility for all job descriptions in all user libraries. I then looked at the size of the user space afterwards to get an idea of how much space was actually required. The size was 3584, so I changed the create size to 5120 to allow for an increase in the number of libraries and job descriptions-you may need to modify this depending on your configuration.

Once the user space is created, we are ready to load it with information from the system and then retrieve and process that information. This is done by program JOBD001RG (see 7). The mainline code in this program is very simple; an overview of the program follows.

Once the user space is created, we are ready to load it with information from the system and then retrieve and process that information. This is done by program JOBD001RG (see Figure 7). The mainline code in this program is very simple; an overview of the program follows.

JOBD001RG accepts the parameters submitted by the user through the *ENTRY parameter list, initializes several variables and executes the process object list subroutine (PRCOBL). The PRCOBL subroutine processes the job description object list one entry at a time, retrieving the job description information by executing the get job description (GETJBD) subroutine.

The GETJBD subroutine executes the print job description (PRTJBD) subroutine, where it is determined if any of the objects submitted by the user are found in the job description. Follow the remainder of this discussion closely if you want to gain some insight into how a program can obtain information from the list APIs.

Most of the list APIs work in a similar manner. They load a user space with four sections of information. The first section is the general header section which provides information about the other sections' locations and some basic information about them.

The other three sections, known as the list sections, contain the information you requested. The first (Input parameter section) contains an exact copy of the parameters used in the call to the API. The second list section (Header section) contains parameter feedback and global information about each object. Not all list APIs use this section. The third list section (List data section) contains the data you requested. The data is always placed in this section in a specific format; and when there is more than one entry, the entries are always of the same length. This is the section you'll most often be interested in.

To recap, a typical retrieval of information from a list API would be performed like this:

1. List the information to a user space by a call to the appropriate list API.

2. Retrieve the location within the user space of the list data section from the general header section.

3. Process the list data section one entry at a time.

JOBD001RG retrieves the job description by calling the List Objects API (QUSLOBJ) at the beginning of the PRCOBL subroutine. The List Objects API requires four input parameters and one optional input/output parameter for handling errors (this parameter is not used here).

Parameter one contains the user space name to write the information to (JOBD001US). The second parameter requires a format name for the type of list entries you want to retrieve. Since the only thing we're interested in here is the job description name, I use the OBJL0100 format which only supplies the object name, library and type.

Other formats can be used for different kinds of information such as object owner or last saved data. The formats of the various sets of information can be found in the System Programmer's Interface Reference manual. Most of the formats can also be found as data structures in the QATTRPG source file in the QUSRTOOL library.

The third parameter must contain the object name followed by its library. This parameter is already set up the way we want it from the command (there was no need to split the qualified name). The fourth parameter contains the object type (*JOBD).

The user space now contains the information we want-a list of the job descriptions in the library (or libraries) indicated by the user. All we have to do is retrieve each job description to determine if it contains any of the objects the user specified.

First we retrieve the general header to locate the list section containing the list. Again, an API (QUSRTVUS) is called to perform the retrieval. QUSRTVUS requires three input parameters and one input/output parameter. The first input parameter is the name of the user space; the second is the start position within the space to retrieve; and the third parameter is the length of the space to retrieve. The general header always starts in position one and its length is 140 bytes.

The input/output parameter contains the data structure name that represents the format of the general header. Here, we are only interested in the location of the list data section, the list count and the length of each entry. The location is in positions 125-128, the list count is in positions 133-136 and the entry length is in positions 137-140. Notice the data structure in JOBD001RG, called GENHDR, with the three subfields LSTOFF, LSTCNT and ENTLEN defined to contain the information we need.

Now that we have the information from the general header, the program can retrieve the information from the list data section. It does this by calling the same API we used to retrieve the general header. This time, the start position is loaded with the list location found in LSTOFF, plus one. The string length is loaded with the entry length found in ENTLEN. We then enter a DO loop which is iterated the number of times equal to the list count, which is found in the LSTCNT field. Each time we iterate the loop, we add the entry length to our start position (add ENTLEN to STRPOS).

For each iteration, the program executes the GETJBD subroutine to retrieve information about the job description; then we execute another subroutine, PRTJBD, that prints the job description if it contains any objects specified by the user.

Retrieving the job description information is done by calling the Retrieve Job Description Information (QWDRJOBD) API. It requires five parameters. The first parameter places the job description information into a variable-no user space is required. I use a data structure, RCVVAR, which I copied from the QATTRPG source file in QUSRTOOL. The second parameter contains the length of the receiver variable.

Parameter three contains the name of the information format (JOBD0100). The fourth parameter contains the job description name followed by its library. Parameter five is used to receive error information if an error occurs.

Once we receive the job description information, we execute the PRTJBD subroutine to compare the object names found in the job description against the object names submitted by the user. If any of them match, we write the job description information to our report.

Better Safe Than Sorry

Now you can be sure your job descriptions don't end up with obsolete references that may cause you unexpected problems. Just use the FNDJOBDOBJ command and look before you delete.

If you've studied this utility, you probably realize that APIs are really quite easy to work with. There's no reason why you can't start using them to retrieve system informa-tion quickly and efficiently.

Richard Shaler is a senior technical editor at Midrange Computing.

REFERENCE

System Programmer's Interface Reference (SC41-8223, CD-ROM QBKA8401).


The Find Job Descriptions with Objects Utility

Figure 1 Objects Used in Job Descriptions

 Job Description Information 5738SS1 V2R2M0 920925 Job description: SHARIC Library: MGTLIB User profile . . . . . . . . . . . . . . . . . . : *RQD CL syntax check . . . . . . . . . . . . . . . . : *NOCHK Hold on job queue . . . . . . . . . . . . . . . : *NO End severity . . . . . . . . . . . . . . . . . . : 30 Job date . . . . . . . . . . . . . . . . . . . . : *SYSVAL Job switches . . . . . . . . . . . . . . . . . . : 00000000 Inquiry message reply . . . . . . . . . . . . . : *RQD Job priority (on job queue) . . . . . . . . . . : 5 Job queue . . . . . . . . . . . . . . . . . . . : SHARIC Library . . . . . . . . . . . . . . . . . . . : MGTLIB Output priority (on output queue) . . . . . . . : 5 Printer device . . . . . . . . . . . . . . . . . : *USRPRF Output queue . . . . . . . . . . . . . . . . . . : *USRPRF Library . . . . . . . . . . . . . . . . . . . : Message logging: Level . . . . . . . . . . . . . . . . . . . . : 4 Severity . . . . . . . . . . . . . . . . . . . : 0 Text . . . . . . . . . . . . . . . . . . . . . : *NOLIST Log CL program commands . . . . . . . . . . . . : *YES Accounting code . . . . . . . . . . . . . . . . : *USRPRF Print text . . . . . . . . . . . . . . . . . . . : Routing data . . . . . . . . . . . . . . . . . . : QCMDI Request data . . . . . . . . . . . . . . . . . . : *NONE Device recovery action . . . . . . . . . . . . . : *SYSVAL Time slice end pool . . . . . . . . . . . . . . : *SYSVAL Text . . . . . . . . . . . . . . . . . . . . . . : Programmer Job Description Initial library list: GEN.CTL QTEMP GEN.DEV MAGFINAL FULMSG MAGWORK UTILITY MAGORIG MGTLIB MENULIB QGPL * * * * * E N D O F L I S T I N G * * * * * 
The Find Job Descriptions with Objects Utility

Figure 2 The FNDJOBDOBJ Command Prompt

 Find JOBD's with Objects (FNDJOBDOBJ) Type choices, press Enter. Job description . . . . . . . . *ALL Name, generic*, *ALL Library . . . . . . . . . . . *ALLUSR Name, *ALL, *ALLUSR... Library . . . . . . . . . . . . *NONE Name, *NONE Job Queue . . . . . . . . . . . *NONE Name, *NONE Out Queue . . . . . . . . . . . *NONE Name, *NONE User name . . . . . . . . . . . *NONE Name, *NONE Printer device . . . . . . . . . *NONE Name, *NONE Output . . . . . . . . . . . . . * *, *PRINT Bottom F3=Exit F4=Prompt F5=Refresh F12=Cancel F13=How to use this display F24=More keys 
The Find Job Descriptions with Objects Utility

Figure 3 FNDJOBDOBJ Output

 UNABLE TO REPRODUCE GRAPHICS 
The Find Job Descriptions with Objects Utility

Figure 4 The FNDJOBDOBJ Command

 /*===============================================================*/ /* To compile: */ /* */ /* CRTCMD CMD(XXX/FNDJOBDOBJ) PGM(XXX/JOBD001CL) + */ /* SRCFILE(XXX/QCMDSRC) */ /* */ /*===============================================================*/ FNDJOBDOBJ: CMD PROMPT('Find JOBD''s with Objects') PARM KWD(JOBD) TYPE(QUAL_JOBD) MIN(0) PROMPT('Job + description') QUAL_JOBD: QUAL TYPE(*GENERIC) DFT(*ALL) SPCVAL((*ALL)) QUAL TYPE(*NAME) DFT(*ALLUSR) SPCVAL((*ALL) + (*ALLUSR) (*CURLIB) (*LIBL) (*USRLIBL)) + PROMPT('Library') PARM KWD(LIB) TYPE(*NAME) LEN(10) DFT(*NONE) + SPCVAL((*NONE)) PROMPT('Library') PARM KWD(JOBQ) TYPE(*NAME) LEN(10) DFT(*NONE) + SPCVAL((*NONE)) PROMPT('Job Queue') PARM KWD(OUTQ) TYPE(*NAME) LEN(10) DFT(*NONE) + SPCVAL((*NONE)) PROMPT('Out Queue') PARM KWD(USER) TYPE(*NAME) LEN(10) DFT(*NONE) + SPCVAL((*NONE)) PROMPT('User name') PARM KWD(PRTDEV) TYPE(*NAME) LEN(10) DFT(*NONE) + SPCVAL((*NONE)) PROMPT('Printer device') PARM KWD(OUTPUT) TYPE(*CHAR) LEN(6) RSTD(*YES) + DFT(*) VALUES(* *PRINT) PROMPT('Output') 
The Find Job Descriptions with Objects Utility

Figure 5 The JOBD001CL Command Processing Program

 /*===============================================================*/ /* To compile: */ /* */ /* CRTCLPGM PGM(XXX/JOBD001CL) SRCFILE(XXX/QCLSRC) */ /* */ /*===============================================================*/ JOBD001CL: + PGM PARM(&QJOBD &LIB &JOBQ &OUTQ &USER &PRTDEV &OUTPUT) DCL VAR(&ATR) TYPE(*CHAR) LEN(10) DCL VAR(&AUT) TYPE(*CHAR) LEN(10) VALUE('*CHANGE') DCL VAR(&JOBQ) TYPE(*CHAR) LEN(10) DCL VAR(&LIB) TYPE(*CHAR) LEN(10) DCL VAR(&OUTPUT) TYPE(*CHAR) LEN(6) DCL VAR(&OUTQ) TYPE(*CHAR) LEN(10) DCL VAR(&PRTDEV) TYPE(*CHAR) LEN(10) DCL VAR(&QJOBD) TYPE(*CHAR) LEN(20) DCL VAR(&INIT) TYPE(*CHAR) LEN(1) DCL VAR(&MSGDTA) TYPE(*CHAR) LEN(80) DCL VAR(&MSGF) TYPE(*CHAR) LEN(10) DCL VAR(&MSGFLIB) TYPE(*CHAR) LEN(10) DCL VAR(&MSGID) TYPE(*CHAR) LEN(7) DCL VAR(&SIZE) TYPE(*DEC) LEN(10 0) VALUE(5120) DCL VAR(&TEXT) TYPE(*CHAR) LEN(50) VALUE('Find JOBDs + with Objects User Space') DCL VAR(&USER) TYPE(*CHAR) LEN(10) DCL VAR(&USRSPC) TYPE(*CHAR) LEN(20) VALUE('JOBD001US + QTEMP') MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR)) IF COND(%SST(&QJOBD 11 1) *NE '*') THEN(CHKOBJ OBJ(%SST(&QJOBD + 11 10)) OBJTYPE(*LIB)) IF COND(&LIB *EQ '*NONE' *AND &JOBQ *EQ '*NONE' *AND &OUTQ *EQ + '*NONE' *AND &USER *EQ '*NONE' *AND &PRTDEV *EQ '*NONE') + THEN(SNDPGMMSG MSGID(CPF9898) MSGF(QCPFMSG) MSGDTA('You must + enter at least one object name') MSGTYPE(*ESCAPE)) CHKOBJ OBJ(QTEMP/JOBD001US) OBJTYPE(*USRSPC) MONMSG MSGID(CPF9801) EXEC(CALL PGM(QUSCRTUS) PARM(&USRSPC &ATR + &SIZE &INIT &AUT &TEXT)) IF COND(&OUTPUT *EQ '*') THEN(OVRPRTF FILE(JOBD001P) HOLD(*YES)) CALL PGM(JOBD001RG) PARM(&QJOBD &LIB &JOBQ &OUTQ &USER &PRTDEV) IF COND(&OUTPUT *EQ '*') THEN(DO) DSPSPLF FILE(JOBD001P) SPLNBR(*LAST) DLTSPLF FILE(JOBD001P) SPLNBR(*LAST) ENDDO RETURN ERROR: + RCVMSG MSGTYPE(*EXCP) MSGDTA(&MSGDTA) MSGID(&MSGID) MSGF(&MSGF) + MSGFLIB(&MSGFLIB) SNDPGMMSG MSGID(&MSGID) MSGF(&MSGFLIB/&MSGF) MSGDTA(&MSGDTA) + MSGTYPE(*ESCAPE) ENDPGM: + ENDPGM 
The Find Job Descriptions with Objects Utility

Figure 6 The JOBD001P Printer File

 *============================================================ * To compile: * * CRTPRTF FILE(XXX/JOBD001P) SRCFILE(XXX/QDDSSRC) * *============================================================ A R HDR A SKIPB(002) A 2DATE EDTCDE(Y) A 45'Job Descriptions Containing Select- A ed Objects' A 123'Page' A 128PAGNBR EDTCDE(4) A 2SPACEB(002) A 'Job Description . . . :' A JOBD 10A O +3 A 4SPACEB(001) A 'Library . . . . . . :' A JOBDL 10A O +5 A 2SPACEB(001) A 'Library . . . . . . . :' A LIB 10A O +3 A 2SPACEB(001) A 'Job Queue . . . . . . :' A JOBQ 10A O +3 A 2SPACEB(001) A 'Out Queue . . . . . . :' A OUTQ 10A O +3 A 2SPACEB(001) A 'User . . . . . . . . :' A USER 10A O +3 A 2SPACEB(001) A 'Printer Device . . . :' A PRTDEV 10A O +3 A 12'Job Desc ' A SPACEB(003) A 78'Job Queue' A 100'Out Queue' A 122'Printer ' A 1'Job Desc' A SPACEB(001) A 12'Library' A 23'Job Description Text' A 59'INLLIBL' A 67'Job Queue' A 78'Library' A 89'Out Queue' A 100'Library' A 111'User' A 122'Device' A 1SPACEB(001) A '----------' A +1'----------' A +1'----------------------------------- A -' A +1'-------' A +1'----------' A +1'----------' A +1'----------' A +1'----------' A +1'----------' A +1'----------' A R DETAIL A SPACEB(001) A JDNAME 10A O 1 A JDLIB 10A O 12 A TXT35 35A O 23 A ILLST 1A O 62 A JQNAME 10A O 67 A JQLIB 10A O 78 A OQNAME 10A O 89 A OQLIB 10A O 100 A USRNAM 10A O 111 A PDEVNA 10A O 122 A R FTR A SPACEB(002) A 40'* * * * * E N D O F' A +3'L I S T I N G * * * * *' 
The Find Job Descriptions with Objects Utility

Figure 7 The JOBD001RG RPG Program

 *============================================================ * To compile: * * CRTRPGPGM PGM(XXX/JOBD001RG) SRCFILE(XXX/QRPGSRC) * *============================================================ *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+.. FJOBD001PO E 90 PRINTER E ARL 25 11 * Data Structure for API: General Header for User Space IGENHDR DS I B 125 1280LSTOFF I B 133 1360LSTCNT I B 137 1400ENTLEN * Data Structure for API: QUSLOBJ IINPUT DS I 1 20 USRSPC I 21 28 FMTNAM I 29 48 OBJLII I 49 58 OBJTYI ILIST DS I 1 20 OBJLIL I 11 20 LIBNML * Data Structure for API: QWDRJOBD IRCVVAR DS 1000 I 9 18 JDNAME I 19 28 JDLIB I 29 38 USRNAM I 55 64 JQNAME I 65 74 JQLIB I 87 96 OQNAME I 97 106 OQLIB I 109 118 PDEVNA I 310 344 TXT35 I B 361 3640OFFLIB I B 365 3680NUMLIB * Data Structure for API: error code IERROR DS I B 1 40BYTPRV I B 5 80BYTAVA I 9 15 ERRID I 16 16 ERR### I 17 256 EXPDTA I DS I B 1 40STRPOS I B 5 80STRLEN I B 9 120RCVLEN IWRKVAR DS 275 * I 'JOBD001US QTEMP 'C USNAME C *ENTRY PLIST C PARM QJOBD 20 C PARM LIB C PARM JOBQ C PARM OUTQ C PARM USER C PARM PRTDEV C MOVELLIB LIB11 11 C MOVELQJOBD JOBD C MOVE QJOBD JOBDL C WRITEHDR C EXSR PRCOBL C WRITEFTR C MOVE *ON *INLR *================================================================ C PRCOBL BEGSR *================================================================ * Process job description object list C CALL 'QUSLOBJ' C PARM USNAME USRSPC C PARM 'OBJL0100'FMTNAM C PARM QJOBD OBJLII C PARM '*JOBD' OBJTYI C CALL 'QUSRTVUS' C PARM USNAME USRSPC C PARM 1 STRPOS C PARM 140 STRLEN C PARM GENHDR C LSTOFF ADD 1 STRPOS C Z-ADD20 STRLEN C DO LSTCNT C CALL 'QUSRTVUS' C PARM USNAME USRSPC C PARM STRPOS C PARM STRLEN C PARM LIST C EXSR GETJBD C ADD ENTLEN STRPOS C ENDDO C ENDSR *================================================================ C GETJBD BEGSR *================================================================ * Get job description information C Z-ADD256 BYTPRV C CALL 'QWDRJOBD' C PARM RCVVAR C PARM 1000 RCVLEN C PARM 'JOBD0100'FMTNAM C PARM OBJLIL C PARM ERROR C OFFLIB ADD 1 X 30 C 275 SUBSTRCVVAR:X WRKVAR C MOVEAWRKVAR ARL C EXSR PRTJBD C ENDSR *================================================================ C PRTJBD BEGSR *================================================================ * Print job descriptions C MOVE 'N' FOUND 1 C MOVE 'N' ILLST C LIB IFNE '*NONE' C DO NUMLIB I 30 C LIB11 IFEQ ARL,I C MOVE 'Y' FOUND C MOVE 'Y' ILLST C LEAVE C ENDIF C ENDDO C FOUND IFEQ 'N' C LIB IFEQ JQLIB C LIB OREQ OQLIB C MOVE 'Y' FOUND C ENDIF C ENDIF C ENDIF C FOUND IFEQ 'Y' C JOBQ ORNE '*NONE' C JOBQ ANDEQJQNAME C OUTQ ORNE '*NONE' C OUTQ ANDEQOQNAME C USER ORNE '*NONE' C USER ANDEQUSRNAM C PRTDEV ORNE '*NONE' C PRTDEV ANDEQPDEVNA C WRITEDETAIL C *IN90 IFEQ *ON C WRITEFTR C WRITEHDR C MOVE *OFF *IN90 C ENDIF C ENDIF C ENDSR *================================================================ *. 1 ...+... 2 ...+... 3 ...+... 4 ...+... 5 ...+... 6 ...+.. 
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  • SB Profound WC 5536 Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application. You can find Part 1 here. In Part 2 of our free Node.js Webinar Series, Brian May teaches you the different tooling options available for writing code, debugging, and using Git for version control. Brian will briefly discuss the different tools available, and demonstrate his preferred setup for Node development on IBM i or any platform. Attend this webinar to learn:

  • SB Profound WP 5539More than ever, there is a demand for IT to deliver innovation. Your IBM i has been an essential part of your business operations for years. However, your organization may struggle to maintain the current system and implement new projects. The thousands of customers we've worked with and surveyed state that expectations regarding the digital footprint and vision of the company are not aligned with the current IT environment.

  • SB HelpSystems ROBOT Generic IBM announced the E1080 servers using the latest Power10 processor in September 2021. The most powerful processor from IBM to date, Power10 is designed to handle the demands of doing business in today’s high-tech atmosphere, including running cloud applications, supporting big data, and managing AI workloads. But what does Power10 mean for your data center? In this recorded webinar, IBMers Dan Sundt and Dylan Boday join IBM Power Champion Tom Huntington for a discussion on why Power10 technology is the right strategic investment if you run IBM i, AIX, or Linux. In this action-packed hour, Tom will share trends from the IBM i and AIX user communities while Dan and Dylan dive into the tech specs for key hardware, including:

  • Magic MarkTRY the one package that solves all your document design and printing challenges on all your platforms. Produce bar code labels, electronic forms, ad hoc reports, and RFID tags – without programming! MarkMagic is the only document design and print solution that combines report writing, WYSIWYG label and forms design, and conditional printing in one integrated product. Make sure your data survives when catastrophe hits. Request your trial now!  Request Now.

  • SB HelpSystems ROBOT GenericForms of ransomware has been around for over 30 years, and with more and more organizations suffering attacks each year, it continues to endure. What has made ransomware such a durable threat and what is the best way to combat it? In order to prevent ransomware, organizations must first understand how it works.

  • SB HelpSystems ROBOT GenericIT security is a top priority for businesses around the world, but most IBM i pros don’t know where to begin—and most cybersecurity experts don’t know IBM i. In this session, Robin Tatam explores the business impact of lax IBM i security, the top vulnerabilities putting IBM i at risk, and the steps you can take to protect your organization. If you’re looking to avoid unexpected downtime or corrupted data, you don’t want to miss this session.

  • SB HelpSystems ROBOT GenericCan you trust all of your users all of the time? A typical end user receives 16 malicious emails each month, but only 17 percent of these phishing campaigns are reported to IT. Once an attack is underway, most organizations won’t discover the breach until six months later. A staggering amount of damage can occur in that time. Despite these risks, 93 percent of organizations are leaving their IBM i systems vulnerable to cybercrime. In this on-demand webinar, IBM i security experts Robin Tatam and Sandi Moore will reveal:

  • FORTRA Disaster protection is vital to every business. Yet, it often consists of patched together procedures that are prone to error. From automatic backups to data encryption to media management, Robot automates the routine (yet often complex) tasks of iSeries backup and recovery, saving you time and money and making the process safer and more reliable. Automate your backups with the Robot Backup and Recovery Solution. Key features include:

  • FORTRAManaging messages on your IBM i can be more than a full-time job if you have to do it manually. Messages need a response and resources must be monitored—often over multiple systems and across platforms. How can you be sure you won’t miss important system events? Automate your message center with the Robot Message Management Solution. Key features include:

  • FORTRAThe thought of printing, distributing, and storing iSeries reports manually may reduce you to tears. Paper and labor costs associated with report generation can spiral out of control. Mountains of paper threaten to swamp your files. Robot automates report bursting, distribution, bundling, and archiving, and offers secure, selective online report viewing. Manage your reports with the Robot Report Management Solution. Key features include:

  • FORTRAFor over 30 years, Robot has been a leader in systems management for IBM i. With batch job creation and scheduling at its core, the Robot Job Scheduling Solution reduces the opportunity for human error and helps you maintain service levels, automating even the biggest, most complex runbooks. Manage your job schedule with the Robot Job Scheduling Solution. Key features include:

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • LANSAWhen it comes to creating your business applications, there are hundreds of coding platforms and programming languages to choose from. These options range from very complex traditional programming languages to Low-Code platforms where sometimes no traditional coding experience is needed. Download our whitepaper, The Power of Writing Code in a Low-Code Solution, and:

  • LANSASupply Chain is becoming increasingly complex and unpredictable. From raw materials for manufacturing to food supply chains, the journey from source to production to delivery to consumers is marred with inefficiencies, manual processes, shortages, recalls, counterfeits, and scandals. In this webinar, we discuss how:

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • Profound Logic Have you been wondering about Node.js? Our free Node.js Webinar Series takes you from total beginner to creating a fully-functional IBM i Node.js business application.

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: