Difference between revisions of "INVENGQRY"

From MidrangeWiki
Jump to: navigation, search
m (Explanation for the Program)
m (Explanation for the Program)
Line 9: Line 9:
 
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 mischef.
 
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 mischef.
  
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.
+
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.
 
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.

Revision as of 06:52, 26 May 2005


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

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.

Here is the Source Code

/*********************************************************************/ /* */ /* Program INVENGQRY runs Query of user choice */ /* */ /*********************************************************************/

             PGM                                                        
                                                                        
/*                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