@Enrico Parisi Thank you, sample message below. I would like that if PMP found, send only the first segment containing PMP and ignore the rest. 

MSH|^~\&|MESA_OP|XYZ_HOSPITAL|iFW|ABC_HOSPITAL|040112043835||BAR^P05|0000000001|T|2.3|
EVN||20200420134725||
PID|||3000222452||DOE^JOHN^E||19931114|M||||||||||1546740|666381774|
PV1||I|BRACKENRIDGE|||||023434|||||||||023434|||||||||||||||||||||||||||20031121||
PV2||||||||||||||||||||||||||||||||||||||
OBX|||||4100|
DG1|1||784.3^APHASIA^I9C||200750816|A
DG1|2||784.0^HEADACHE^I9C||200750816|A
DRG|640^^APP-DRG S43 (2024)^^^^I10||015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|Admission DRG|015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|PPC DRG|015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|PPC Admit DRG|015|.2017|||^^0|^^|0|||Completed|20231204085141|PMP, CODER|CODER||N
ABS|||||||20231204085141
DRG|555^^PMP S43 (2024)^^^^I10||015|.2017|3.1|3.1|^^97585.77|^^|1358.36|||Completed|20231204085141|PMP, CODER|CODER||Y
ABS|||||||20231204085141
DRG|555^^PMP S43 (2024)^^^^I10|HAC Dx Included|015|.2017|3.1|3.1|^^97585.77|^^|1358.36|||Completed|20231204085141|PMP, CODER|CODER||N
ABS|||||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10||015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|Admission DRG|015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|PPC DRG|015|.0944|1.8|1.7|^^0|^^|0|1|1|Completed|20231204085141|PMP, CODER|CODER||N
ABS|||1||||20231204085141
DRG|640^^APP-DRG S43 (2024)^^^^I10|PPC Admit DRG|015|.2017|||^^0|^^|0|||Completed|20231204085141|PMP, CODER|CODER||N
ABS|||||||20231204085141

Thank you @Luis Angel Pérez Ramos I used your suggestion and it worked.  Thank you @Jeffrey Drumm for showing me how to set the EXTRACT function. I used $EXTRACT(context.ObxTrunc,1,470) where context.OBxTrunc is the context variable holding the original message.  

In the BPL, I passed the message through the newly created DTL that was looking if the OBX 5 characters(bytes) were greater than 400, if so, I took the substring of the first 470. (I tried taking 480/ 490/ 500 but that would cause the message to error) then following Luis's suggestion, I defined another context variable with the same type than the original message as output.