ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » VariableLengths for the optional fields in record delimited

Post new topic  Reply to topic
 VariableLengths for the optional fields in record delimited « View previous topic :: View next topic » 
Author Message
siri2083
PostPosted: Thu Jun 06, 2024 9:17 pm    Post subject: VariableLengths for the optional fields in record delimited Reply with quote

Apprentice

Joined: 16 Apr 2009
Posts: 39

Hi Team,

The input file has 4 records (Header, item, itemextn and trailer). Each record has initiator and fields are of fixed length. There are few optional fields in these records.

When we pass the exact length for all fields the DFDL parses successfully.

There is a special case, some source systems can send the data less than defined length for optional field. Then parser fails with below error. Can we handle variable lengths for the optional fields by assuming the following optional fields are also does not have data?

Error:

"CTDP3058E: Separator '%LF;' not found at offset '174' for sequence within element '/BatchFile_Message[1]'.
ParsedDataRegion[SimpleContent, startOffset = 173, length = 1, scd = #xscd(/schemaElement::BatchFile_Message/type::0/model::sequence/schemaElement::body/type::0/model::sequence/schemaElement::ItemExtention/type::0/model::sequence/sch"

Sample Message:

00Journalaaa20240606GL
20Journalaaa20240606AccCGLOL 123X
21Journalaaa20240606OrderNum 001A
20Journalaaa20240606AccCGLOL2 123X
21Journalaaa20240606OrderNum2
20Journalaaa20240606AccCGLOL3 123X
21Journalaaa20240606OrNum3
99Filler2

DFDL Schema:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<xsd:schema xmlns:dfdl="http://www.ogf.org/dfdl/dfdl-1.0/" xmlns:fn="http://www.w3.org/2005/xpath-functions" xmlns:ibmDfdlExtn="http://www.ibm.com/dfdl/extensions" xmlns:ibmSchExtn="http://www.ibm.com/schema/extensions" xmlns:recFixLengthFieldsFmt="http://www.ibm.com/dfdl/RecordFixLengthFieldFormat" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:import namespace="http://www.ibm.com/dfdl/RecordFixLengthFieldFormat" schemaLocation="IBMdefined/RecordFixLengthFieldFormat.xsd"/>
<xsd:annotation>
<xsd:appinfo source="http://www.ogf.org/dfdl/">
<dfdl:format encoding="{$dfdl:encoding}" escapeSchemeRef="" occursCountKind="fixed" ref="recFixLengthFieldsFmt:RecordFixLengthFieldsFormat"/>
</xsd:appinfo>
</xsd:annotation>
<xsd:element dfdl:lengthKind="delimited" ibmSchExtn:docRoot="true" name="BatchFile_Message">
<xsd:complexType>
<xsd:sequence dfdl:separator="%LF;" dfdl:separatorPosition="postfix" dfdl:separatorSuppressionPolicy="anyEmpty">
<xsd:element dfdl:initiator="00" dfdl:lengthKind="delimited" name="header">
<xsd:complexType>
<xsd:sequence>
<xsd:element dfdl:length="10" ibmDfdlExtn:sampleValue="a" name="Journal" type="xsd:string"/>
<xsd:element dfdl:length="8" ibmDfdlExtn:sampleValue="a" name="Date" type="xsd:string"/>
<xsd:element dfdl:length="2" dfdl:occursCountKind="implicit" ibmDfdlExtn:sampleValue="a" minOccurs="0" name="Application" type="xsd:string"/>
<xsd:element dfdl:length="12" dfdl:occursCountKind="implicit" ibmDfdlExtn:sampleValue="a" minOccurs="0" name="Filler1" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element dfdl:initiator="20" dfdl:lengthKind="delimited" dfdl:occursCountKind="implicit" maxOccurs="unbounded" name="body">
<xsd:complexType>
<xsd:sequence dfdl:separator="%LF;" dfdl:separatorPosition="infix" dfdl:separatorSuppressionPolicy="anyEmpty">
<xsd:element dfdl:lengthKind="delimited" ibmDfdlExtn:sampleValue="body_valu1" name="Item">
<xsd:complexType>
<xsd:sequence>
<xsd:element dfdl:length="10" ibmDfdlExtn:sampleValue="head_valu2" name="Journal" type="xsd:string"/>
<xsd:element dfdl:length="8" ibmDfdlExtn:sampleValue="head_valu3" name="Date" type="xsd:string"/>
<xsd:element dfdl:length="10" dfdl:occursCountKind="implicit" minOccurs="0" name="Account" type="xsd:string"/>
<xsd:element dfdl:length="3" dfdl:occursCountKind="implicit" minOccurs="0" name="Amount" type="xsd:string"/>
<xsd:element dfdl:length="1" dfdl:occursCountKind="implicit" minOccurs="0" name="Indicator" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element dfdl:initiator="21" dfdl:lengthKind="delimited" dfdl:lengthPattern=".*" ibmDfdlExtn:sampleValue="body_valu2" name="ItemExtention">
<xsd:complexType>
<xsd:sequence>
<xsd:element dfdl:length="10" ibmDfdlExtn:sampleValue="a" name="Journal" type="xsd:string"/>
<xsd:element dfdl:length="8" ibmDfdlExtn:sampleValue="a" name="Date" type="xsd:string"/>
<xsd:element dfdl:length="10" dfdl:occursCountKind="implicit" minOccurs="0" name="Order" type="xsd:string"/>
<xsd:element dfdl:length="3" dfdl:occursCountKind="implicit" minOccurs="0" name="Quantity" type="xsd:string"/>
<xsd:element dfdl:length="1" dfdl:occursCountKind="implicit" minOccurs="0" name="Department" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
<xsd:element dfdl:initiator="99" dfdl:lengthKind="delimited" dfdl:occursCountKind="implicit" minOccurs="0" name="trailer">
<xsd:complexType>
<xsd:sequence>
<xsd:element dfdl:length="10" dfdl:occursCountKind="implicit" ibmDfdlExtn:sampleValue="a" minOccurs="0" name="Filler2" type="xsd:string"/>
<xsd:element dfdl:length="22" dfdl:occursCountKind="implicit" ibmDfdlExtn:sampleValue="a" minOccurs="0" name="Filler3" type="xsd:string"/>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » WebSphere Message Broker (ACE) Support » VariableLengths for the optional fields in record delimited
Jump to:  



You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.