Debugging the problem with EXECR function or others resulting in system signal errors

June 28, 2006 – 8:07 am

This Post has been posted by a third-party in a discussion group and the same has been posted here since it is useful in the context of AI and debugging:

You can try running a “strace” on the translation on each differing system.

Strace is a system call trace, i.e. a debugging tool which prints out a trace of all the system calls made by a another process/program. The program to be traced need not be recompiled for this, so you can use it on binaries for which you don’t have source. System calls and signals are events that happen at the user/kernel interface. A close examination of this boundary is very useful for bug isolation, sanity checking and attempting to capture race conditions.

In the simplest case strace runs the specified command until it exits. It intercepts and records the system calls which are called by a process and the signals which are received by a process. … System administrators, diagnosticians and trouble-shooters will find it invaluable for solving problems with programs for which the source is not readily available since they do not need to be recompiled in order to trace them. Students, hackers and the overly-curious will find that a great deal can be learned about a system and its system calls by tracing even ordinary programs. And programmers will find that since system calls and signals are events that happen at the user/kernel interface, a close examination of this boundary is very useful for bug isolation, sanity checking and attempting to capture race conditions. [http://www.die.net/doc/linux/man/man1/strace.1.html]

To Run:
Put your inittrans statement in a translation.sh script (and put a “sleep 20″ as the very first line)
Execute à ./translation.sh &
This will toss the translation into the background and pop out a PID to STDOUT for the backgrounded process
Before your sleep time set ends, type and Execute à strace –T –f –p PID# > /tmp/translation.log
This will generate a strace output showing what happens system call wise with the translation. You can then look for the 126 return on PROD and the 0 return on PREPROD in the log and try to figure out what is causing the error.

TAI Segment on 997

April 11, 2006 – 3:46 pm

AI generates a TA1 on the outbound 997 when your trading partner sends
a 1 in ISA14. Have your partners send a 0 in the ISA14 and AI will not
generate a TA1 segment on the outbound 997.

Or one could go into TradeGuide at the GS level of the partner and
Select “None” for the Functional Ack Level. This will turn the 997 off
for that partner.

Time Conversion Tip

April 11, 2006 – 3:33 pm

This post has been published in a discussion group by a third-party and has been published here since it is relevant to the mapping techniques in AI:

Requirements:
While working on a global implementation (Application Integrator
centrally located on a US machine) we had requirements to convert AI
generated date/time to local date/time. There were 3 different
components of the requirements:
i) Date/time conversion in the data segments.
ii) Date/time conversion in the envelopes of
X12/EDIFACT standards & 997/CONTROL messages.
iii) Many countries we were trying to implement also
had daylight saving system. Date/time conversion was required to take
this into account too.

Solution:
In order to fulfill above mentioned requirements we did following:
i) Defined a function in User.inc to calculate the
time zone (and if daylight saving on or not) of the machine running
AI. Although Trade Guide have a configuration to store the time zone,
it doesn’t have any daylight saving aware settings (at least I don’t
know about it).So we relied on EXECR and a small Unix script to know
the time-zone/daylight of the machine running AI.
ii) In the trade guide profile we created a custom
tab under partner profile which hold following values:
1. Country time zone. List of countries supported with time conversion.
2. If time/date conversion is required in enveloping model and
Acks. Yes/No.
iii) We defined another function in User.inc to
calculate local date/time. In this function date/time difference
between US time (say CST) and the regional time (say Australia). This
required us to hard code some values (like time difference and
daylight saving dates)
iv) For all data maps where local date/time is
required we asked our regional mapping teams to use this function
(defined in step iii) to convert AI generated date/time to local
date/time.
v) For enveloping/Ack models we copied
OT*Evp.mdl/OT*Ack.mdl into SCJ*Evp.mdl/SCJ*Ack.mdl and added the time
conversion function in there. Time conversion function in these models
is called only when the TP profile had “time/date conversion on
enveloping” set to yes.

ANSI ASC X12 Standards Info

April 7, 2006 – 8:41 am

http://www.x12.org/x12org/index.cfm

De-referencing ARRAYS with no values on target …. A complete loop could be skipped in the output

February 3, 2006 – 3:58 pm

Sometimes if ARRAYS are being de-referenced on the target and if the last ARRAY doesn’t have a value, then that loop might not appear in the output. To avoid the problem, always have another condition which will always work or another assignment where there is always a value.

Output file is not created in the appl directory if $X12MsgInTestName has a path setup like this – b/TESTMAP

February 3, 2006 – 3:51 pm

Output file is not created in the appl directory for Inbound translations if X12MsgInTestName (network filename in the inbound tab) has a path like b/TESTMAP. Just TESTMAP is good enough because the sysappl path is automatically attached.
You will typically get error messages like these:

1 Executing: Copy from b/TESTMAP.SessionNo, to :appl\b/TESTMAP.SessionNo
163 EXEC Error On: otpack.exe b/TESTMAP.SessionNo archive\_b/TESTMAP.SessionNo

To extract the last x characters in a string or a number

February 3, 2006 – 3:25 pm

Always use this principle to get the last x characters:

VAR->lastxcharacters = STRSUBS(VAR->lastxcharacters,x-1,STRLEN(VAR->lastxcharacters))

AI tries to read the source file again when one intends to parse the target

February 3, 2006 – 3:19 pm

AI tries to read the source file from where it left off when one expects AI to parse the target, if the declaration in .att file is mentioned as S_MODEL and S_ACCESS instead of T_MODEL and T_ACCESS.

This might happen in rare scenario when somebody is trying to create the attachments and models manually using a text editor.

Various combinations of Numeric and Date formatting

February 3, 2006 – 3:14 pm

Run
inittrans -at OTFmt.att -cs $OT_QUEUEID -tl 0 -I (on Unix)
otrun -at OTFmt.att -cs $OT_QUEUEID -tl 0 -I (On windows)

The output file “OTFmt.out” created in the home directory will have all the formats and respective outputs that one should expect for each kind of Date or Numeric formatting.

Map doesn’t write all records if there is DM Item used outside its definition in Target

February 3, 2006 – 2:49 pm

If a DM Item is used outside its definition in the Target, the map will not produce the output correctly. This usually happens when you copy an existing DM items rules definition and forget to change the DM item name.

This error is in AI 3.2 and it might have been corrected in the new versions.