Difference between revisions of "INVENGQRY"
(→Explanation for the Program) |
MrDolomite (talk | contribs) m (-cat Category:CLP/400) |
||
(2 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
− | |||
− | |||
− | |||
− | |||
== Explanation for the Program == | == 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. | 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 | + | 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. | 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. | ||
Line 27: | Line 23: | ||
== Here is the Source Code == | == Here is the Source Code == | ||
+ | <pre> | ||
/*********************************************************************/ | /*********************************************************************/ | ||
/* */ | /* */ | ||
− | |||
/* Program INVENGQRY runs Query of user choice */ | /* Program INVENGQRY runs Query of user choice */ | ||
− | |||
/* */ | /* */ | ||
/*********************************************************************/ | /*********************************************************************/ | ||
Line 44: | Line 39: | ||
ENDIT: ENDPGM | ENDIT: ENDPGM | ||
+ | </pre> | ||
+ | |||
+ | ==Categories== | ||
+ | [[Category:CLP/400 examples]] | ||
+ | [[Category:Query]] |
Latest revision as of 20:41, 31 July 2008
Contents
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 means INVENTORY in BPCS
INV is probably the most common area for which people are granted access to BPCS security applications
At http://www.globalwiretechnologies.com/ 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 */ /* */ /*********************************************************************/ 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