Newsletters Subscriptions Media Kit About Us Contact Search Home

mgo
OS/400 Edition
Volume 3, Number 23 -- April 4, 2003

Odds and Ends


Dear Readers:

Here are more miscellaneous tips and techniques. These are in response to short questions you've sent in.

--Ted

Question:

The Display Program (DSPPGM) command shows us the name modification time of the source member from which an OPM program was compiled. How do we get the same information for an ILE RPG program?

Answer:

Under ILE, a source member is compiled into a module. Modules are combined to form programs. As I heard one wag say that ILE means it's a "linkage editor."

The information you seek is available through the same DSPPGM command. Press Enter a couple of times, until you arrive at the screen 3. (At least it's screen 3 under V5R1.) You'll see the modules listed. Chances are there's only one. Option 5 shows the source member information.

Question:

How can I identify IBM objects that our shop has changed?

Answer:

Run the Display Object Description (DSPOBJD) command to build an outfile and look at the ODUMOD field. Changed objects have a value of 1. Unchanged objects have a value of 0.

Question:

I have an application where users place text files in QDLS folders. I use the QRYDOCLIB command to search through these folders for items to be processed. The results of the command are placed in the file. This file is then used as an input file to direct processing of the text files.

Our users want to use the IFS, but the QRYDOCLIB only works with QDLS. Is there any way in a CL program to obtain the contents of an IFS folder and place the results in a text file that can be accessed by CL commands, or directly into an AS/400 file?

Answer:

Qshell can handle this task for you. Try this.

crtpf mylib/dirlist rcdlen(80)

qsh cmd ('ls >/qsys.lib/mylib.lib/dirlist.file/dirlist.mbr ')

Question:

In the October 17, 2001, issue of Midrange Guru, you wrote about the system reply list ["Automatically Reply To Inquiry Messages"]. Can I use the same reply list to have the system automatically reply to the verify alignment message (CPA4002) on my AS/400 printers? If so, do I need to do anything else besides add an entry to the system reply list?

Answer:

Sure, that will work. You'll need to use the CMPDTA parameter if you only want to trap the message for certain printers.

ADDRPYLE  SEQNBR(xxxx) MSGID(CPA4002) CMPDTA(PRT05 41) RPY(G)

This example shows how to automatically answer message CPA4002 for printer PRT05. To answer message CPA4002 for all printers, leave out the CMPDTA parameter.

Question:

One of our CL programs quit working properly not long ago. We finally found the bug. We had improperly defined a new parameter in an RPG program that is called from the CL. The called RPG program was overlaying a logical variable with a garbage value. Yet the CL program did not bomb. Why not?

Answer:

CL will not allow you to assign a value other than 0 or 1 to a logical variable. However, when CL tests a logical variable, it accepts a value of 1 as true and any other value as false.

Question:

Is there any way to print user ID in the header of a Query/400 report? Our users print many pages of queries but don't collect them. Since we use network printers, it is hard to know who prints each report.

Answer:

I don't know of any way to put the user ID in the query header, but you can put it at the bottom of the page if you wish.

RTVJOBA USER(&USER) 
OVRPRTF FILE(QPQUPRFIL) PRTTXT(&USER)
RUNQRY etc.

You should also check into some of the report utilities on the market.


Sponsored By
SNAP-E BOOKS

Snap-eBooks is a new publishing company dedicated to the principle
that great products and tools do not have to cost a lot!

Snap-eBooks completely disagrees with the current industry practice that says that you should charge whatever the market will bear for AS/400 related products.

We believe that keeping the prices of our products low makes them accessible and affordable for everyone in our industry including programmers, operators, administrators, managers, and pretty much anyone else. After all, why should a book cost $89? At that price, only companies or corporations can afford them. Our low prices also mean that you can purchase however many eBooks you need, and get them when you need them.

Each eBook is full of step-by-step information that you can use to immediately learn a given topic in a short amount of time.

Download the Lightning-Guide eReader and then take a look at our sample eBook, called Introduction to Visual Age for RPG, and check it out for yourself just how useful our products really are.

See for yourself.
www.snap-ebooks.com


THIS ISSUE
SPONSORED BY:

Advanced Systems Concepts
Snap-E Books


BACK ISSUES

TABLE OF
CONTENTS

Pros and Cons of Surrogate Keys

Odds and Ends

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.