TechTip: Qshell vs. PASE

General
Typography
  • Smaller Small Medium Big Bigger
  • Default Helvetica Segoe Georgia Times

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
  Alan Seiden founded Seiden Group to help IBM i shops design and implement high-performance web and mobile applications using PHP, DB2, RPG business logic and Zend Framework best practices. Alan and his team work closely with some of the best minds at both Zend and IBM on behalf of their clients.With a passion for open source and community, Alan co-developed the popular PHP Toolkit with IBM. He was one of the first Zend Framework certified engineers; co-founder of the NYC Zend Framework Meetup; charter member of IBM/COMMON's PHP Advisory Board; and a consultant for IBM's manual PHP: Zend Core for i5/OS. An award-winning speaker, Alan has been called "the performance guru of PHP on IBM i." He shares his expertise regularly at conferences and user groups such COMMON, ZendCon, the RPG & DB2 Summit, OMNI, the Northeast Users Group Conference, OCEAN and WMCPA. He also mentors other developers within the Club Seiden forum.In his spare time, Alan plays the trombone and studies and teaches the Feldenkrais Method® of Somatic Education.Subscribe to Alan’s monthly newsletter PHP on IBM i Tips.  Follow Alan on Twitter: @alanseiden and LinkedIn: www.linkedin.com/in/alanseidenMore on Alan
BLOG COMMENTS POWERED BY DISQUS

LATEST COMMENTS

Support MC Press Online

$

Book Reviews

Resource Center

  •  

  • LANSA Business users want new applications now. Market and regulatory pressures require faster application updates and delivery into production. Your IBM i developers may be approaching retirement, and you see no sure way to fill their positions with experienced developers. In addition, you may be caught between maintaining your existing applications and the uncertainty of moving to something new.

  • The MC Resource Centers bring you the widest selection of white papers, trial software, and on-demand webcasts for you to choose from. >> Review the list of White Papers, Trial Software or On-Demand Webcast at the MC Press Resource Center. >> Add the items to yru Cart and complet he checkout process and submit

  • SB Profound WC 5536Join us for this hour-long webcast that will explore:

  • Fortra IT managers hoping to find new IBM i talent are discovering that the pool of experienced RPG programmers and operators or administrators with intimate knowledge of the operating system and the applications that run on it is small. This begs the question: How will you manage the platform that supports such a big part of your business? This guide offers strategies and software suggestions to help you plan IT staffing and resources and smooth the transition after your AS/400 talent retires. Read on to learn: