I have input data like this:
ST*315*4299~
B4***VD~
N9*BM*DE435433~
N9*BN*USQMV411664~
Q2*LIB*U.S*******EB614***L*LIBERTY~
R4*D*K*USBAL*BALTIMORE,D~
DTM*139*20060420*0500~
R4*L*D*DEBRH*BREMERHAVEN~
DTM*140*20060403*1230~
SE*10*4299~
In one of my output fields I want the 3rd element from one of the DTM lines. The logis is:
If B4-03 = 'VD'
use the DTM-02&03 for the R4 loop where R4-01 is 'L'
Else
use the DTM-02&03 for the R4 loop where R4-01 is 'D'
(for purposes of this, I'll use "ABC" instead.
I assumed the code would be:
IF(Ship'tStatusCd Element:B4 Segment:In1="VD", FromDateTime(EXTRACT(Date ElementTM Segment:LoopR4 QO315:In1, PortFunctionCd Element:R4 Segment:LoopR4 QO315:In1="L"),"CCYYMMDD") + " " + EXTRACT(Time ElementTM Segment:LoopR4 QO315:In1, PortFunctionCd Element:R4 Segment:LoopR4 QO315:In1="L"),
"ABC")
Now, if I grab just the Date element it works. If I grab just the time element, it works. But when I put them together (as above) it comes back with a blank.
Any idea?
ST*315*4299~
B4***VD~
N9*BM*DE435433~
N9*BN*USQMV411664~
Q2*LIB*U.S*******EB614***L*LIBERTY~
R4*D*K*USBAL*BALTIMORE,D~
DTM*139*20060420*0500~
R4*L*D*DEBRH*BREMERHAVEN~
DTM*140*20060403*1230~
SE*10*4299~
In one of my output fields I want the 3rd element from one of the DTM lines. The logis is:
If B4-03 = 'VD'
use the DTM-02&03 for the R4 loop where R4-01 is 'L'
Else
use the DTM-02&03 for the R4 loop where R4-01 is 'D'
(for purposes of this, I'll use "ABC" instead.
I assumed the code would be:
IF(Ship'tStatusCd Element:B4 Segment:In1="VD", FromDateTime(EXTRACT(Date ElementTM Segment:LoopR4 QO315:In1, PortFunctionCd Element:R4 Segment:LoopR4 QO315:In1="L"),"CCYYMMDD") + " " + EXTRACT(Time ElementTM Segment:LoopR4 QO315:In1, PortFunctionCd Element:R4 Segment:LoopR4 QO315:In1="L"),
"ABC")
Now, if I grab just the Date element it works. If I grab just the time element, it works. But when I put them together (as above) it comes back with a blank.
Any idea?