From MidrangeWiki
Jump to: navigation, search

Explanation for the Program

For various reasons, to be explained in later links, Query is humongously popular at many AS/400 sites but at the same time comes with a mountain of security concerns.

Thus, IT wants to let co-workers run any Query definition they please, from some Menu, but not from either command line or IBM commands, which can let them get into unwanted mischief.

Here is a simple CLP/400 program that permits users to key in what Query definition they want to run, then change the default selection criteria. Meanwhile, the Query definition involved, remains intact.

A remaining challenge is that ideally we want people to do this stuff, then have their Query head off to the JOBQ for actual execution. Programming that is more complex than this example.

This program is one of a set of related CLP/400 examples.

Naming Conventions Clarification


INV is probably the most common area for which people are granted access to BPCS security applications

At INVENG signifies access to engineering data about how the products are structured. Most everyone who is granted INV* access is also given INVENG* access.

Note that the Query definition inside the CLP program does not need to obey the BPCS Naming Conventions.

Here is the Source Code

/*                                                                   */ 
/* Program INVENGQRY  runs Query of user choice */ 
/*                                                                   */ 
 /*                Chapter SIX of CL manual explains the rules        */ 
              RUNQRY     ??QRY(XQRY_AVIEW) RCDSLT(*YES)                  
              MONMSG     MSGID(CPF6801) EXEC(GOTO CMDLBL(ENDIT)) /* +    
                           F3 F12 etc. allowed */                        
              ENDIT:      ENDPGM