× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



True, the error monitoring is better, but I try to catch errors other ways. 
For example, If I am to create a file in QTEMP, I issue the command (either 
CRTDUPOBJ or CRTPF), then open(E) the file. If there is an error, I would 
rather deal with it that way, than monitoring the CL command. 

Hmmm... maybe I should be using the API to dup an object....

On 9/2/05, rob@xxxxxxxxx <rob@xxxxxxxxx> wrote:
> 
> I used to be a big system() fan. Then I went back to QCMDEXC. The psds
> returns information from QCMDEXC that is not available in the errorcode
> returned by system(). For example, let's say there was a mythical message
> "USR0154-Object in use by &1". With the psds and QCMDEXC you could get
> the value for &1. Now, for true message thoroughness nothing beats
> QCAPCMD. The psds can only return so many characters of message data. No
> such limitation with QCAPCMD. I find that most times that QCMDEXC is
> "good enough" and is easier to code. (I know, I know a good wrapper...
> but then you get into activation group levels, etc.)
> 
> And the people who say using a CL is easier because of MONMSG etc, would
> throw their mother from the train before using a Monitor structure in
> RPGLE.
> 
> Rob Berendt
> --
> Group Dekko Services, LLC
> Dept 01.073
> PO Box 2000
> Dock 108
> 6928N 400E
> Kendallville, IN 46755
> http://www.dekko.com
> 
> 
> 
> 
> 
> Tony Carolla <carolla@xxxxxxxxx>
> Sent by: rpg400-l-bounces@xxxxxxxxxxxx
> 09/02/2005 01:51 PM
> Please respond to
> RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
> 
> 
> To
> RPG programming on the AS400 / iSeries <rpg400-l@xxxxxxxxxxxx>
> cc
> 
> Subject
> Re: Using CL to call RPG pgms
> 
> 
> 
> 
> 
> 
> I personally don't use CL in any new projects. I actually just re-wrote my
> 
> initial program in RPG, using APIs. ;-)
> 
> Here's how I handle the stuff. First of all, system() is much easier to
> use
> than QCMDEXC, in my opinion. In case you haven't used it, you prototype it
> 
> as follows:
> 
> D system PR 10I 0 ExtProc('system')
> D szCmd * Value
> D Options(*String)
> 
> D RC S 10I 0 Inz
> 
> Then, you can use it as follows:
> 
> RC=system('CRTPF ...');
> 
> If RC=0, the command was successful. There are more options for checking
> the
> detailed error (see many posts on system())
> 
> For specifying which library to find files in (rather than using OVRDBF),
> I
> use the EXTFILE keyword on the F-specs, that tells exactly what
> library/file
> to open. You can even use a variable, and set the file as USROPN. Then, in
> 
> your calcs, resolve the variable and open the file. If you need to hit the
> 
> file in multiple places, close it, re-resolve the variable, and open it
> again. Of course, when you compile, your current library list is searched
> for the file, but once compiled, you are in the driver's seat as to which
> file to actually open.
> 
> Another thing to consider is the use of APIs. When you are using system()
> or
> QCMDEXC to run a CL Command, often times the CL command runs a program
> that
> uses APIs to perform the action. For these, it might be beneficial to just
> 
> prototype the API, and call it from within the RPG program. I wrote a
> program that displays field level details, in a much more abbreviated
> fashion than DSPFFD, and rather than use DSPFFD to an outfile, I used
> QUSLRCD, QUSLFLD and QDBRTVFD (to get key data) directly. It is very fast.
> 
> 
> But some might say that this approach is too complex, when you can simply
> issue a CL command.
> 
> 
> On 9/2/05, Igor.Beslic@xxxxxxxxxxxx <Igor.Beslic@xxxxxxxxxxxx> wrote:
> >
> > Hello!
> >
> > I have almost 1,5 year expirience in ILE RPG IV and now I realized that
> > almost evry RPG pgm I've made needed additional CL pgm that shold
> prepare
> > LIBL, clear output PFs and perform similar actions after pgm finises...
> >
> 
> 
> 
> --
> "Enter any 11-digit prime number to continue..."
> "In Hebrew SQL, how do you use right() and left()?..." - Random Thought
> "If all you have is a hammer, all your problems begin to look like nails"
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
> 
> 
> --
> This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
> To post a message email: RPG400-L@xxxxxxxxxxxx
> To subscribe, unsubscribe, or change list options,
> visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
> or email: RPG400-L-request@xxxxxxxxxxxx
> Before posting, please take a moment to review the archives
> at http://archive.midrange.com/rpg400-l.
> 
> 



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.