|
You need to show us the codeI
Regards
Paul Tuohy
ComCon
www.comconadvisor.com
www.systemideveloper.com
Srinivas Boggula wrote:
Hi Paul,Log File.
I am getting complete Junk value when I tried to move a numeric value to
Newrecord Value or Old Record value to my data base field
Regards,
Srinivas
________________________________________
Subject: Re: Trigger Program-Error
Hi Srinivas,
Assuming the code is what you had in your earlier e-mail, you need to
add 1 to the offset on the substring
EVAL FYD8TX = %SubSt(@Parm1: NewOffSet :
NewLength)
Should be
EVAL FYD8TX = %SubSt(@Parm1: NewOffSet+1 :
NewLength)
Srinivas Boggula wrote:
Hi All,
In my Physical file I have a numeric field when i tried to move
I am getting junk value.
I am stucked here can any one please let me know the solution.
Thanks in advance
________________________________________
Subject: Re: Trigger Program.
Hi Srinivas,
The example you referenced was using hard coded lengths - which is why
NewOffSet+1 : 10)said it wasn't a good example.
|0005.03 C Eval NAME = %SubSt(@Parm1:
NewOffset + 11:0005.04 C Eval ADDRESS = %SubSt(@Parm1:
TrgEvent,OrigOffSet,OrigLength,NewOffSet,NewLength0005.05 C 10)
|
Srinivas Boggula wrote:
Hi Paul,
Thanks for the information
but I am not hard coding lengths instead I am taking values from DS
In DS we have subfileds of
be "1"
when ever we try to add record to a particular file TrigeEvent will
for new data.NewOffSet and NewLength will be used for Add operation
and Delete operation Triger Event will be '2'
OrigOffSet and OrigLength will be used for Delete operation
And for Update Operation triger event will be "3"
OrigOffSet and OrigLength for old data and NewOffSet and NewLength
DS
Example:
SELECT
TrgEvent WHENEQ '1'
Eval FYD7TX = 'ADD'
EVAL FYD8TX = %SubSt(@Parm1: NewOffSet :
NewLength)
TrgEvent WHENEQ '2'
Eval FYD7TX = 'DELETE'
EVAL FYD8TX = %SubSt(@Parm1: OrigOffSet:
OrigLength)
TrgEvent WHENEQ '3'
Eval FYD7TX = 'UPDATE'
EVAL FYD8TX = %SubSt(@Parm1: OrigOffSet :
OrigLength)
EVAL FYC1TX = PGMUSER
WRITE FFYRES5
EVAL FYD8TX = %SubSt(@Parm1: NewOffSet :
NewLength)
ENDSL
EVAL FYC1TX = PGMUSER
WRITE FFYRES5
Eval *InLr = *On
Regards,
Srinivas
________________________________________
Subject: Re: Trigger Program.
Hi Srinivas,
It may be simple but not a good example. Apart from the fact that the
theuses 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
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;
As an Amazon Associate we earn from qualifying purchases.
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.