Newsletters Subscriptions Media Kit About Us Contact Search Home

mgo
OS/400 Edition
Volume 3, Number 29 -- April 25, 2003

Printing Qshell Output


Hey, Ted:

Would it be possible to use REXX to send the output of a Qshell command to a printer file? I have just begun exploring REXX on the iSeries platform--we are migrating from an Integrated Server S/30 (VSE/ESA) and the REXX there has absolutely spoiled me.

--Mitch


As of V5R2, it is possible, Mitch. In V5R2, IBM added a rexx command to Qshell. This command lets you run REXX scripts from Qshell.

To illustrate how this works, here's my REXX procedure, QSHELLPRT, in MYLIB/QREXSRC.

/* Send Qshell output to QSYSPRT */    
'OVRPRTF FILE(STDOUT) TOFILE(QSYSPRT)' 
do forever                             
   parse linein data                   
   if data == '' then leave            
   say data                            
end                                    
'DLTOVR FILE(STDOUT)'

Within Qshell, I ran the following command to print the output from an ls command.

ls fu* | rexx /qsys.lib/mylib.lib/qrexsrc.file/qshellprt.mbr

The REXX procedure must be in a library, but the name of the REXX source member has to be given in IFS syntax.

--Ted


Sponsored By
ADVANCED SYSTEMS CONCEPTS

TOP TEN REASONS

Why You Should
Retire Query/400

Yes, there is a much better way!

Learn how you can access and present
AS/400 and iSeries
database information
without jumping through hoops.

Read More


THIS ISSUE
SPONSORED BY:

Advanced Systems Concepts
Kisco Information Systems


BACK ISSUES

TABLE OF
CONTENTS

Printing Qshell Output

Telnet Access in a Pinch

Reader Feedback and Insights: Left in the Dust


Editors
Howard Arner
Joe Hertvik
Ted Holt
David Morris

Managing Editor
Shannon Pastore

Publisher and
Advertising Director:

Jenny Thomas

Advertising Sales Representative
Kim Reed

Contact the Editors
Do you have a gripe, inside dope or an opinion?
Email the editors:
editors@itjungle.com

Copyright © 1996-2008 Guild Companies, Inc. All Rights Reserved.