The problem is that the N1 segment is the last segment in the header
section.  The last one that is mapped, if it's mapped at all. And even
in the standard, there's not much going on after the address loops.

Section breaks within Gentran:Basic are sort of vital and data can't
cross section breaks.   I can't put any logic in the N1 because for the
ones that AREN'T the N1, the logic will never fire because the N1 isn't
encountered.  Catch 22.

Functions?  It is to laugh.  About the only thing I might be able to get
away with is a translation table, but again, it has to be coded at the
N1 segment and if it's not there, I'm more or less out of luck.

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of
Michael Mattias/LS
Sent: Saturday, February 05, 2011 6:22 PM
To: EDI-L
Subject: Re: [EDI-L] Mapping output where no input segment exists

> The map already makes provision for the N1 segment in it.  That's not
> the issue.
>
> Take a look at the second interchange I provide.  **THE N1 IS NOT
> PRESENT**.   How can I map something that's not there?  That's like
> saying "Everybody who's not here, raise your hand."  :)
>
> Gentran:Basic is a funny animal.  I came from the Mentor product, so I
> do have experience with at least one other mapping tool; but this one
is
> pretty different.

Actually, no it isn't.

"Do <something> when <something else> is not found in the input" is
actually 
a fairly common mapping challenge (outside the classroom in The Real
World).

Most mapping tools will have a Present() or Exists() or found() or
MIssing() 
or absent() function, or allow you to do what in Sql/Server is a
"nullif"... 
provide a list of 'source' data to be mapped to the 'target' , selecting
the 
first non-null item in the list.

In your case your map logic needs to be, If Missing( N1 Segment), map 
"MISSING" else map N1Segment

I'm not familiar with your specific tool.  If it does not have one of
the 
functions above, perhaps you can set a flag when you get the N1 Segment.
If 
that flag is false when you think you are done, you are not done: you
have 
to set the default values to account for the absence of that N1 segment.

Something like that, anyway.

Michael C. Mattias
Tal Systems Inc.
Racine WI
[email protected]







------------------------------------

...
Please use the following Message Identifiers as your subject prefix:
<SALES>, <JOBS>, <LIST>, <TECH>, <MISC>, <EVENT>, <OFF-TOPIC>

Job postings are welcome, but for job postings or requests for work:
<JOBS> IS REQUIRED in the subject line as a prefix.Yahoo! Groups Links






------------------------------------

...
Please use the following Message Identifiers as your subject prefix: <SALES>, 
<JOBS>, <LIST>, <TECH>, <MISC>, <EVENT>, <OFF-TOPIC>

Job postings are welcome, but for job postings or requests for work: <JOBS> IS 
REQUIRED in the subject line as a prefix.Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/EDI-L/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/EDI-L/join
    (Yahoo! ID required)

<*> To change settings via email:
    [email protected] 
    [email protected]

<*> To unsubscribe from this group, send an email to:
    [email protected]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

Reply via email to