TechTip: Qshell vs. PASE PDF Print E-mail
Written by Alan Seiden   
Thursday, 30 March 2006

When you tap the power of UNIX, use your shell of choice.

Many iSeries/i5 professionals think of Qshell and i5/OS Portable Application Solutions Environment (PASE) almost interchangeably. Both environments provide access to an integrated UNIX environment without the need to manage a separate partition. In addition, both offer a command shell (a program that runs commands interactively or from a script) and the ability to run UNIX commands, utilities, and programs.

Qshell and i5/OS PASE even have similar-looking terminal environments (Figures 1 and 2).

http://www.mcpressonline.com/articles/images/2002/seiden_alan_techtip_qshell_vs_paseV4--03310600.png

Figure 1: Qshell Command Entry looks almost identical to PASE (Figure 2, below). (Click images to enlarge.)

http://www.mcpressonline.com/articles/images/2002/seiden_alan_techtip_qshell_vs_paseV4--03310601.png

Figure 2: PASE's default Korn shell (also known as "-sh") strongly resembles Figure 1.

Qshell and PASE have separate sets of utilities and commands. Some, such as ls and cd, are present in both environments, while others, such as diff, are present in one but not the other.

Does that mean we should choose an environment based on the commands we wish to use? Perhaps, but it is not a requirement. Qshell and PASE can execute each other's utilities and commands. For example, in "Vive la Diff," I showed how to use PASE's diff command. I stated that this command ran more easily in PASE than in Qshell. Reader Randy Adamski asked me directly, "Is it possible to run this command in Qshell?" The answer was "Yes," but that it required locating the command in PASE's default command path, /QOpenSys/usr/bin.

One definite difference is that Qshell is EBCDIC-based and PASE is ASCII-based. To put Qshell to the test, I asked Qshell to execute PHP, an AIX binary that I normally run in PASE. PHP is an ASCII-encoded program. Did it work in Qshell? Yes. I ran the PHP –v command to show PHP's version information, presumably encoded in ASCII. Qshell translated the results into its EBCDIC environment, proudly showing me the result:

PHP 4.3.9 (cgi) (built: Feb 4 2005 15:04:33)
Copyright (c) 1997-2004 The PHP Group
Zend Engine v1.3.0, Copyright (c) 1998-2004 Zend Technologies
$      

Just as Qshell often is able to reverse its EBCDIC nature when needed, ASCII-based PASE can access EBCDIC system resources. PASE does this with its commands:
qsh (call a Qshell command) and system (call a native i5/OS command).

Qshell vs. PASE Comparison Chart


Qshell
i5/OS PASE
Product ID
5722-SS1 option 30
5722-SS1 option 33
Cost
Free
Free since V5R2
Location of commands and utilities
/usr/bin
/QOpenSys/usr/bin
Available shells
A unique ILE port combining Korn and Bourne
Port of AIX with three choices: Korn (-sh, default), Bourne (-bsh), and C (-csh)
How to invoke an interactive (terminal) shell
CALL QP2TERM
Runs Korn shell by default. Accepts parameters to run different programs such as the C shell:
CALL PGM(QP2term) PARM('/qopensys/usr/bin/csh')
How to run a UNIX utility, command, or program from standard i5/OS environment
QSH or STRQSH (yes, same as above). Pass program name and arguments as a single parameter.
CALL QP2SHELL (for new ILE activation group) or
CALL QP2SHELL2 (for caller's activation group). Pass program name and arguments as separate parameters.
Case-sensitive?
No, unless otherwise instructed
Yes, when utilities run from default location, QOpenSys/usr/bin
Character encoding
EBCDIC
ASCII
Implementation of utilities
Symbolic links to ILE i5/OS programs in QSHELL library (e.g., /usr/bin/ls = /qsys.lib/qshell.pgm/ls.pgm)
AIX binaries

How to Choose

I asked IBM's Walt Madden when we should choose one environment over the other. He suggested, "You might choose i5/OS PASE over Qshell if the program you are trying to run already exists in the UNIX (especially AIX) space. Conversely, you might choose Qshell over i5/OS PASE if the program needs to be tightly coupled to i5/OS ILE APIs."

Additional Resources

This Qshell tutorial is a fine introduction to Qshell. To go further, read the definitive Qshell resource, Qshell for iSeries, by Ted Holt and Fred A. Kulack. To learn about PASE, try this excellent introductory PASE article by Walt Madden. Also see the official PASE documentation.

Alan Seiden is Senior Developer and Technical Lead at Strategic Business Systems, Inc., in Ramsey, New Jersey, where he helps clients reach their business goals using IBM iSeries/i5, Microsoft, and open-source technology, with an emphasis on usability. Alan is an advisory board member of the New York City Usability Professionals Association. Contact Alan at This e-mail address is being protected from spam bots, you need JavaScript enabled to view it .


Last Updated ( Thursday, 30 March 2006 )
 
Discuss (4 posts)
Guest.Visitor
TechTip: Qshell vs. PASE
Apr 03 2006 13:11:00
Brian, <p>I agree, the man (manual) command would be handy. To my knowledge, though, it's not available in Qshell or PASE. <p>Alan
#120221
bharder@nlrha.ab.ca
TechTip: Qshell vs. PASE
Apr 03 2006 12:37:00
Does either environment support the man pages? I did some experimenting with QShell and found it didn't have much in the way of command help. This was some time ago, so things may have changed. <p>A friend, better versed in the Unix way, steered me towards the man (manual) command. This I quickly learned was one of the standard Unix commands for learning the system. Unfortunately, QShell didn't have this. <p>I realize that there are alternatives. However, it's better I find to have the help system right there, in the same environment where you work. Also, there is a lot of variation in the Unix inspired command sets. I frequently bumped in to the problem of finding an answer, but it wouldn't work in the environment I was in.
#120220
A.Seiden
TechTip: Qshell vs. PASE
Mar 31 2006 11:29:00
Readers, in what situations have you chosen Qshell over PASE or vice versa? How did you choose? Please share your comments or questions with us.
#120219
MC Press Web Site Staff
TechTip: Qshell vs. PASE
Apr 03 2006 13:11:00
This is a discussion about <B>TechTip: Qshell vs. PASE</b>.<p align='center'><a href=http://www.mcpressonline.com/mc?1@232.1KNKfHX1eQT.17@.6b36311c>Click here for the article</a>.</p>
#120218


Discuss...
User Rating: / 0
PoorBest 
Related Articles
< Prev   Next >

   MC-STORE.COM