Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Gentran NT 3.1 mapping problems

Status
Not open for further replies.

svg1970

IS-IT--Management
Jun 17, 2001
14
0
0
US
1. Is there any way to trace the translator flow / path - from ISA/GS/ST thru SE/GE/IEA?
2. How do I initialize a temporary segment element? Will 'empty(#var-name)' statement do?
3. Or, do I need to use an assignment to initialize temp vars?
4. How do I initialize a temp variable of 'date' type? Assign spaces?

5. Are there different statements to initialize / empty / clear segment-elements Vs. record-field Vs. temp-segment-elements Vs. variables declared in extended rules? Can I use 'empty' statement initializing - all these categories?
6. What is the scope of accessing/initialising various segments/ elements records/fiedls from extended rules. Can I access them from any group on Input / Output side? Is there any restrictions?

---------------------------------------------------------------------------------
I have this scenario of X12 867 Inbound mapping; which is giving me the problem.

ST
BPT 1 Mandatory
DTM 2 Conditional
Temporary_Storage_Segment_level_1
Temp_Start_Date_1 element
Temp_End_Date_1 element
N1_group upto 2 times
N1 1 conditional
Temporary_Storage_Segment_level_2
Temp_Start_Date_2 element
Temp_End_Date_2 element

PTD_group upto 999999 Mandatory ----------> There is no prblem below this level
PTD upto 10 Conditional ----------> They are sub-HDR, DTLs / sub-detail groups
N1_Group 1 conditional ----------> which get mapped correctly
'''''''''''''''
'''''''''''''''

On the output side :
--------------------
N1 group is currently mapped to a 'BR' header record . Input file always contain 2 occurances of N1 segments. Currently, the map checks for N101 ID = 'DB' and maps the segment to 'BR' in output. If it is not = 'DB', all elements in N1 are cleared using empty(#...) statements.
Using the current version of the map, it writes 'BR' record only once - and multiple HDR/DTL blocks.

The change I want to make: Check the qualifier in DTM01 (='090' or '091), populate a field Start_Date or End_date in the BR record on output. (Current input always contain 2 DTM segments, which were not mapped to output in the map)

What I tried to do
1. create a temp. segment (with date elements Start:1 & End:1 after DTM, at the same level as DTM
2. Code On-End extended rule for DTM, to check DTM01, move DTM02 to either Start:1 or End:1
3. Create another temprary segment (with variables Start:2 and End:2) after N1 (this is mapped to BR record on the output side currently. I need to add Start and End date to this 'BR' record), at the same level as N1 in the N1 group.
4. Code extended rule for element Start:2 to assign #Start:2 = $867.#Start:1;
5. Code extended rule for element End:2 to assign #End:2 = $867.#End:1;

It writes the 'BR' record perfectly with data from N1 (N101='DB') segment and dates saved from DTM segments. However it writes (after the first BR, HDR/DTL block) an additional 'BR' record with only the 'BR' tag and the dates saved from DTM segments. All values mapped from N1 - the second occurance of N1
where N101 != 'DB' - where cleared by the 'empty' statements.

I have tried to clear all elements /fields at all levels on Input/Output sides wherever I stored the date values, but it still does not seem to happen and the one extra BR record with start and end dates is still being written.

I have been incrementaly adding 'empty' statements to various groups on Input and Output and testing each version. They all created the same output with an extra 'BR' record per ST to SE transaction. So I think I am doing something very basic the wrong way and I cant figure
out what it is. Not much documentation available at the client place either.

I know it is a lot I am asking for. Answer whatever your time permits. Thank you!

 
I don't quite follow the mapping details but I can answer some of your questions based on an older version of Gentran. The current version may or may not have the same syntax and / or functionality.

I don't know of a way of tracing in Gentran like an interactive debugger has, but I have resorted to using well placed messagebox functions in the extended rules. The messagebox function pauses execution during a translation and can be used to display a string. Check you manual for usage details.

To initialize a datetime variable use the date function. It has the following syntax:
date(yyyy,m,d,h,n,s) where the time components are optional.

As for scope, each variable is only in scope for it's defined level and any nested loops / segments underneath it. A variable is only in scope on its defined "side" of the map. Use a global variable if you want it to stay in scope for the entire document. Only mapping allows you to copy data from one side of the map to the other.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top