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



Srinivas

Did you INZ the data structure FYD8TX ?

D FYD8TX E DS EXTFILE(file) INZ

Or are you referencing the correct DS (before or after image of the record)
?
If event is INSERT use the AFTER image, the BEFORE image is not filled.
Event is DELETE the use BEFORE , never AFTER (same reason)


With regards,
Carel Teijgeler


*********** REPLY SEPARATOR ***********

On 19-8-2010 at 20:52 Paul Tuohy wrote:

You need to show us the code

Regards

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

Srinivas Boggula wrote:
Hi Paul,

I am getting complete Junk value when I tried to move a numeric value to
Log File.

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
Newrecord Value or Old Record value to my data base field
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
I
said it wasn't a good example.

|0005.03 C Eval NAME = %SubSt(@Parm1:
NewOffSet+1 : 10)
0005.04 C Eval ADDRESS = %SubSt(@Parm1:
NewOffset + 11:
0005.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
TrgEvent,OrigOffSet,OrigLength,NewOffSet,NewLength

when ever we try to add record to a particular file TrigeEvent will
be "1"
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
for new data.

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
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;




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.