ToLMF map

This example is based on MT540, but it is valid for any occurrence of 35B.

There will be a rule such as the following:
ToLMF_FinInstID ( EITHER (  ISIN# General Line SubField:ISIN<>IDOfFI #35B NonISO15022 General Field:54x_BSequence , "N/A" ) ,
                               EITHER ( Narrative_35x General Line SubField[1] IN IDOfFI #35B NonISO15022 General Field:54x_BSequence , "N/A" ) , 
                               EITHER ( Narrative_35x General Line SubField[2] IN IDOfFI #35B NonISO15022 General Field:54x_BSequence , "N/A" ) , 
                               EITHER ( Narrative_35x General Line SubField[3] IN IDOfFI #35B NonISO15022 General Field:54x_BSequence , "N/A" ) ,
                               EITHER ( Narrative_35x General Line SubField[4] IN IDOfFI #35B NonISO15022 General Field:54x_BSequence , "N/A" ) )

This rule can be amended to look for the alternative format given in the Usage Rules, and call another functional map:

= IF ( LEFT ( Narrative_35x General Line SubField[1]:Narrative<>IDOfFI #35B NonISO15022 General Field:54x_BSequence, 1 ) = "/" &
( MID ( Narrative_35x General Line SubField[1]:Narrative<>IDOfFI #35B NonISO15022 General Field:54x_BSequence, 4, 1 ) ="/" |
  MID ( Narrative_35x General Line SubField[1]:Narrative<>IDOfFI #35B NonISO15022 General Field:54x_BSequence, 6, 1 ) ="/" ) &
  SIZE ( WORD ( Narrative_35x General Line SubField[1]:Narrative<>IDOfFI #35B NonISO15022 General Field:54x_BSequence, "/", 3 ) ) > 0,
ToLMF_FinInstID_AltrntId ( Narrative<>IDOfFI #35B NonISO15022 General Field:54x_BSequence ), 
ToLMF_FinInstID ( EITHER (  ISIN# General Line SubField:ISIN<>IDOfFI #35B NonISO15022 General Field:54x_BSequence , "N/A" ) ,
                               EITHER ( Narrative_35x General Line SubField[1] IN IDOfFI #35B NonISO15022 General Field:54x_BSequence , "N/A" ) , 
                               EITHER ( Narrative_35x General Line SubField[2] IN IDOfFI #35B NonISO15022 General Field:54x_BSequence , "N/A" ) , 
                               EITHER ( Narrative_35x General Line SubField[3] IN IDOfFI #35B NonISO15022 General Field:54x_BSequence , "N/A" ) ,
                               EITHER ( Narrative_35x General Line SubField[4] IN IDOfFI #35B NonISO15022 General Field:54x_BSequence , "N/A" ) ) )

The rules for the ToLMF_FinInstID_Altrntld map are as follows, assuming an input card name of 35B_Desc):

LMF Sub-field Mapping rule
f											
TickerSymbol_S				
LocalID_S							
NarrativeVal_S[1]		
NarrativeVal_S[2]		
NarrativeVal[3]			
="FinInstIDVar"
=WORD ( Narrative_35x General Line SubField[1]:35B_Desc, "/",2)
=WORD ( Narrative_35x General Line SubField[1]:35B_Desc, "/",3 )
=Narrative_35x General Line SubField[2]:35B_Desc
=Narrative_35x General Line SubField[3]:35B_Desc
=Narrative_35x General Line SubField[4]:35B_Desc

All other fields can be set to NONE.

Using these rules, an input of the following:

:35B:/TS/IBM Ord
SCTY DESC EXTRA 1
SCTY DESC EXTRA 2

Gives the following LMF element:

<FinInstID s="" f="FinInstIDVar" q="">
        <TickerSymbol>TS</TickerSymbol>
        <LocalId>IBM Ord</LocalId>
        <NarrativeVal>SCTY DESC EXTRA 1</NarrativeVal>
</FinInstID>