× 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.



they also define the 2nd parameter (named @Parm4 in the program)
as 4B 0, which is incorrect. (It should be 10i 0, or if you must use the B data type, it should be 9B 0)

I could also argue that using names like @Parm3 and @Parm4 is another good reason to ignore this example and move on to a better one. I mean, come on folks, naming a field "parm3" by itself is a bad practice... tell us what the bloody field is for, not what number it is! Then adding the @ symbol is bad, because it can cause globalization problems... but then it's not even the 3rd parameter! Good grief.

There are many examples of triggers out there... keep searching.


On 8/18/2010 2:46 AM, Paul Tuohy wrote:
Hi Srinivas,

It may be simple but not a good example. Apart from the fact that the DS
uses absolute notation and binary fields your should NEVER, EVER hard
code lengths/offsets as in the example. What happens this program when
the length of NAME (on the database files - or even worse, on one of the
database files) is changed from 10 to 15?

Should have...

d p_dataIn S *
d dataIn E Ds based(p_dataIn) qualified
/free
p_dataIn = %addr( @parm1 + newOffset );
name = dataIn.name;
address = dataIn.address;

Regards

Paul Tuohy
ComCon
www.comconadvisor.com
www.systemideveloper.com





Srinivas Boggula wrote:
Hi All,

I found another easy way of doing this Please find attached link below.

http://tutorialindia.com/articles/as400/db2_trigger_example_rpg_iv.php

Regards,
Srinivas
iGATE is Ranked No. 1 in DQ-IDC best IT employer survey and Ranked No.2
by Business Today-Mercer Human Resource Consulting-TNS in a cross industry survey of Best Companies to work for in India
----------------------------------------------------------------DISCLAIMER---------------------------------------------------------
Information transmitted by this EMAIL is proprietary to iGATE Group of Companies and is intended for use only by the individual
or entity to whom it is addressed and may contain information that is privileged, confidential, or exempt from disclosure under
applicable law. If you are not the intended recipient of this EMAIL immediately notify the sender at iGATE or mailadmin@xxxxxxxxx
and delete this EMAIL including any attachments




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.