What's the difference of STRQSH and CALL QP2TERM?
时间:2016-06-28 ┊ 阅读:3,224 次 ┊ 标签: 分享 , 系统 , 配置
STRQSH或QSH是QShell,是原生的命令,最初被设计只用来执行原生的程序。当然,现在QShell也可以跑PASE程序如果PASE已经安装的情况下。
STRQSH/QSH is QShell. QShell is a native environment that acts like a Unix shell. In it's original implementation it could only run native programs (i.e. *PGM objects compiled for IBM i. This includes both OPM and ILE *PGM objects.) However, today's QShell can also run PASE programs if PASE is installed.
QP2TERM/QP2SHELL is PASE. (Not QShell). PASE only runs programs compiled for the AIX operating system. It's job is to provide compatibility so that software written/designed for AIX can be run under IBM i. This simplifies things greatly for application developers that already make software for AIX and want to also make it available under IBM i.
QShell's was originally provided for Java developers. Java is supposed to be the same on all systems... and on IBM i (actually, "OS/400" at the time) it couldn't be the same. You couldn't have the same java, javac, jar, etc commands that you have on other platforms because the command-line environment worked very differently. Likewise, you couldn't print out to the scrolling screen interface that's standard on other platforms, pipe data from stdin/stdout, etc, etc. QShell solved that problem. It provided the same command-line interface that other platforms have, the same scrolling screen interface (or one very similar, at any rate), the same stdin/stdout pipe interface, etc. With QShell you can work in Java the same as any other platform.
Meanwhile, PASE was developed by a 3rd party. Since the iSeries and RS/6000 computers at that time used very similar hardware architectures, they thought why not take advantage of that to let you run AIX programs under OS/400? Certain software interfaces must be made available to do that, but the core hardware support is already there. So PASE was invented to supply those software interfaces, so code compiled for AIX could run directly on OS/400 (now known as IBM i). This made it easy to bring software like PHP, InfoZip, GnuPG, BIND, etc to IBM i. These things already existed for AIX, but now without they also run on IBM i.
Since PASE worked so well, IBM took advantage of it too. Some of their software, such as Java, and Tivoli, could be released as AIX code and still run on IBM i. That saves them a lot of development dollars, and ensures their customers always get the latest & greatest versions with the widest amount of testing.
When IBM made Java available in the PASE environment, they had to add support for QShell to run PASE programs -- to maintain backward compatiblity and all that. So QShell can run PASE programs (it knows enough to know when a program was compiled for AIX, and then invokes the actual PASE environment under the covers.) So now QShell command lines can be used to invoke PASE. Which unfortunately blurs the line a bit between QShell/PASE... leads people to be confused, and not understanding the difference between them.
PASE still doesn't run native programs, however. (at least not directly... you can launch them via the 'qsh' tool provided with PASE). QShell, of course, does run native programs.
and that was your error.. 'db2' is a native program, provided with QShell. But you were trying to invoke it from QP2TERM, which is PASE.
Note:
PASE - Portable Application Solution Environment