You are on page 1of 12

MC Press Online

The Find Job Descriptions with Objects Utility


Contributed by Richard Shaler Sunday, 31 October 1993 Last Updated Sunday, 31 October 1993

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:


http://www.mcpressonline.com Powered by Joomla! Generated: 28 August, 2008, 23:54

MC Press Online

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.


http://www.mcpressonline.com Powered by Joomla! Generated: 28 August, 2008, 23:54

MC Press Online

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
http://www.mcpressonline.com Powered by Joomla! Generated: 28 August, 2008, 23:54

MC Press Online

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 descriptionsyou 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.
http://www.mcpressonline.com Powered by Joomla! Generated: 28 August, 2008, 23:54

MC Press Online

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.

http://www.mcpressonline.com

Powered by Joomla!

Generated: 28 August, 2008, 23:54

MC Press Online

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
http://www.mcpressonline.com Powered by Joomla! Generated: 28 August, 2008, 23:54

MC Press Online

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 ***** END OF LISTING ***** 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
http://www.mcpressonline.com

KWD(JOBD) TYPE(QUAL_JOBD) MIN(0) PROMPT('Job +


Powered by Joomla! Generated: 28 August, 2008, 23:54

MC Press Online

description') QUAL_JOBD: QUAL TYPE(*GENERIC) DFT(*ALL) SPCVAL((*ALL)) QUAL TYPE(*NAME) DFT(*ALLUSR) SPCVAL((*ALL) + (*ALLUSR) (*CURLIB) (*LIBL) (*USRLIBL)) + PROMPT('Library') PARM PARM PARM PARM PARM PARM KWD(LIB) TYPE(*NAME) LEN(10) DFT(*NONE) + SPCVAL((*NONE)) PROMPT('Library') KWD(JOBQ) TYPE(*NAME) LEN(10) DFT(*NONE) + SPCVAL((*NONE)) PROMPT('Job Queue') KWD(OUTQ) TYPE(*NAME) LEN(10) DFT(*NONE) + SPCVAL((*NONE)) PROMPT('Out Queue') KWD(USER) TYPE(*NAME) LEN(10) DFT(*NONE) + SPCVAL((*NONE)) PROMPT('User name') KWD(PRTDEV) TYPE(*NAME) LEN(10) DFT(*NONE) + SPCVAL((*NONE)) PROMPT('Printer device') 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))
http://www.mcpressonline.com Powered by Joomla! Generated: 28 August, 2008, 23:54

MC Press Online

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 SelectA 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'
http://www.mcpressonline.com Powered by Joomla! Generated: 28 August, 2008, 23:54

MC Press Online

A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A A

89'Out Queue' 100'Library' 111'User' 122'Device' 1SPACEB(001) '----------' +1'----------' +1'-----------------------------------' +1'-------' +1'----------' +1'----------' +1'----------' +1'----------' +1'----------' +1'----------' R DETAIL SPACEB(001) JDNAME 10A O 1 JDLIB 10A O 12 TXT35 35A O 23 ILLST 1A O 62 JQNAME 10A O 67 JQLIB 10A O 78 OQNAME 10A O 89 OQLIB 10A O 100 USRNAM 10A O 111 PDEVNA 10A O 122 R FTR SPACEB(002) 40'* * * * * E N D O F' +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
http://www.mcpressonline.com Powered by Joomla! Generated: 28 August, 2008, 23:54

MC Press Online

I I I I I I I

65 74 JQLIB 87 96 OQNAME 97 106 OQLIB 109 118 PDEVNA 310 344 TXT35 B 361 3640OFFLIB 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
http://www.mcpressonline.com Powered by Joomla! Generated: 28 August, 2008, 23:54

MC Press Online

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

http://www.mcpressonline.com

Powered by Joomla!

Generated: 28 August, 2008, 23:54