===============================================
SEARCH400 EXPERT PROGRAMMER TIP
August 29, 2001
More programmer tips at 
http://search400.techtarget.com/tipsIndex/0,289482,sid3_tax2f9,00.html
===============================================

SPONSORED BY: ARCAD Software
===============================================
How up to date is your AS/400 technical DOCUMENTATION? ARCAD 
Observer is a unique and powerful AS/400 solution offering a 
completely automated technical documentation process of your 
AS/400 applications. This highly configurable and graphical 
software instantly generates technical documentation 
directly on your PC. The FREE, fully functional NEW AS/400 
Source Code Analyzer for RPG, Cobol & ILE is available to 
the first 500 ARCAD Site visitors at 
http://www.arcadsoftware.com/, or contact Eric at (978) 927-
2931 in the U.S. and Canada.

=================================================
WIN AN OLYMPUS CAMERA 
-- Last week to enter August tips contest
=================================================

This is the last week to submit a technical tip and enter to 
win an Olympus Stylus Epic Zoom camera. Send in yours today 
and you could be like search400 member Raymond Johnson, who 
last month won a Secret Agent Man watch. You can win, too.
http://search400.techtarget.com/tipsSubmit/1,289485,sid3,00.html

==========================================================

Creating dynamic commands in a CL program by using QCMDEXC
By Tim Granatir, search400 expert

Most of us have used QCMDEXC to execute a CL program from an 
RPG program, but you can also use QCMDEXC to execute a 
command from a CL program. At first glance that sounds 
silly, but by using QCMDEXC you can dynamically execute 
commands that your CL program doesn't have to know about at 
compile time. 

You can also execute commands whose total number of 
parameters are not known until time of execution. Some 
possible uses of this technique include, but are not limited 
to, running OPNQRYF with input provided by a user, running 
commands from a menu system, and saving a user's library 
list. The following example program shows a basic use of the 
QCMDEXC command. This program will save the user's library 
list, allow for some sort of processing and then change the 
library list back to its original form when the program is 
done. This is useful if you have users bouncing between 
menus of different application systems that require 
different library lists. 

An additional example of the QCMDEXC command can be found at 
http://www.search400.com/ateQuestionNResponse/0,289625,sid3_cid409729_tax285217,00.html.


CODE:

PGM                                                       
             DCL        VAR(&LIBL) TYPE(*CHAR) LEN(275)              
             DCL        VAR(&CMD) TYPE(*CHAR) LEN(512)               
             DCL        VAR(&LEN) TYPE(*DEC) LEN(15 5) 
VALUE(512)      
                                                                     
BEGIN:                                                               
/*  RETRIEVE ORIGINAL LIBRARY LIST  */                               
             RTVJOBA    USRLIBL(&LIBL)                               
                                                                     
CHGLIBL:                                                             
/*  CHANGE LIBRARY LIST  */                                          
     /* PUT CODE CHANGES HERE */                                     
                                                                     
ENDPGM:                                                              
/*  CHANGE LIBRARY LIST BACK TO ORIGINAL VALUES */                   
             CHGVAR     VAR(&CMD) VALUE('CHGLIBL LIBL(' *CAT 
&LIBL +   
                          *TCAT ')')                                 
             CALL       PGM(QCMDEXC) PARM(&CMD &LEN)                 
             ENDPGM

-----------------------------------------------------------
About the author: Tim is vice president of Technical 
Services at Interlink Technologies in Maumee, Ohio, where he 
serves as chief architect for the company's warehouse 
management system. He has worked in the banking, insurance, 
healthcare and distribution industries in various positions, 
including programmer/analyst, systems analyst and DP 
manager. Tim has worked on IBM midrange platforms since 
1983.

==================================
MORE INFORMATION
==================================

The Best AS/400 Web Links for Programmers
http://search400.techtarget.com/bestWebLinks/0,289521,sid3_tax286870,00.html

Live programmer discussion forum: Ask your programmer 
questions--or help out your peers in this forum
http://search400.discussions.techtarget.com/WebX?50@@.ee84636

Ask the Experts yourself: Our programmer gurus are waiting 
to answer your technical questions.
http://search400.techtarget.com/ateAnswers/0,289620,sid3_tax285217,00.html

What do you think of this tip? Send your comments -- good or 
bad -- to
mailto:[EMAIL PROTECTED]

=========================================
MEMBER-SUBMITTED PROGRAMMER TIPS
=========================================

Search400 members recently submitted the following 
programmer tips. Check them out and rate them so we know 
what you think of them. Your vote will help us decide this 
month's contest winner.

1. Recursive call
Submitted by Roldao Silva 
http://search400.techtarget.com/tip/1,289483,sid3_gci762818,00.html

2. RPG ILE made easier
Submitted by Drew Dekreon 
http://search400.techtarget.com/tip/1,289483,sid3_gci762822,00.html

3. Right-justifying numerical input in a character 
Submitted by Gordon Pu
http://search400.techtarget.com/tip/1,289483,sid3_gci762060,00.html

4. Alternate find messages by description
Submitted by Mark Kennedy
http://search400.techtarget.com/tip/1,289483,sid3_gci762294,00.html

You probably have some tips of your own. Why not send them 
in? You could win some great prizes.
http://search400.techtarget.com/tipsSubmit/1,289485,sid3,00.html

================================ 
SEARCH400 DAILY NEWS E-MAIL
================================ 

"IBM delivers on V5R1, adds a few extras"
"IBM updates Shark's copy functions"

Did you see these headlines yesterday? You would have if you 
received search400's Daily News e-mail. Not only do we give 
you the latest IBM and iSeries news, but we also link you to 
choice articles and Web sites specific to the iSeries in our 
Daily Best Web Links. Sign up to receive search400's free 
news e-mail at 
http://search400.techtarget.com/register/1,,sid3,00.html.

======================================================== 
If you would like to sponsor this or any TechTarget 
newsletter, please contact Gabrielle DeRussy at 
mailto:[EMAIL PROTECTED].
======================================================== 



If you no longer wish to receive this newsletter simply reply to 
this message with "REMOVE" in the subject line.  Or, visit 
http://search400.techtarget.com/register 
and adjust your subscriptions accordingly. 

If you choose to unsubscribe using our automated processing, you 
must send the "REMOVE" request from the email account to which 
this newsletter was delivered.  Please allow 24 hours for your 
"REMOVE" request to be processed.

Reply via email to