# Mandatory records and fields are not generating errors for XML to Flat File Conversions when the ...

**URL:** <https://techcommunity.softwareag.com/t/mandatory-records-and-fields-are-not-generating-errors-for-xml-to-flat-file-conversions-when-the/107351>\
**Category:** Forum\
**Tags:** EDI\
**Created:** [January 18, 2005, 3:08am UTC](https://techcommunity.softwareag.com/t/mandatory-records-and-fields-are-not-generating-errors-for-xml-to-flat-file-conversions-when-the/107351 "2005-01-18T03:08:40Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![mark\_b](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark\_b](https://techcommunity.softwareag.com/u/mark_b)\
**Post date:** [January 18, 2005, 3:08am UTC](https://techcommunity.softwareag.com/t/mandatory-records-and-fields-are-not-generating-errors-for-xml-to-flat-file-conversions-when-the/107351/1 "2005-01-18T03:08:40Z")

</div>

I am converting xml to a flat file and I am running into problems. The good thing is I can get the data to show up exactly the way I want in the Flat File. The problem is I need to have mandatory records and fields and everything I tried so far has not worked. In the Flat File dictionary I made the fields mandatory and in the Flat File Schema I made the records mandatory and this did not generate any errors when I ran my process that used xml that did not have the mandatory fields. I added validators and that did not help. I also tried setting SignalError to “True” in the ConvertToString service but still no errors were generated. I’m running on IS 6-0-1.

Any help would be greatly appreciated.

Thanks,

Mark

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [January 18, 2005, 4:08am UTC](https://techcommunity.softwareag.com/t/mandatory-records-and-fields-are-not-generating-errors-for-xml-to-flat-file-conversions-when-the/107351/2 "2005-01-18T04:08:59Z")

</div>

Because the file has blank/spaces filled for empty fields, validation for required fields is failing.

I have tried the following method.  
1.Include a format service for all required field. This format service should nullify empty fields  
2. Create a document from Flat File schema. Uncheck ‘Field must exit at run time’ checkbox for all required flieds  
3. invoke pub.schema:validate and valid against FF document.  
4. Then invoke convertToString.

Hope will help  
UMG

---

<div class="post-metadata">

**Author:** ![Guest](https://sea1.discourse-cdn.com/techcommunity/user_avatar/techcommunity.softwareag.com/guest/32/75_2.png) [@Guest](https://techcommunity.softwareag.com/u/Guest)\
**Post date:** [January 18, 2005, 4:26am UTC](https://techcommunity.softwareag.com/t/mandatory-records-and-fields-are-not-generating-errors-for-xml-to-flat-file-conversions-when-the/107351/3 "2005-01-18T04:26:17Z")

</div>

Because the file has blank/spaces filled for empty fields, validation for required fields is failing.

I have tried the following method.  
1.Include a format service for all required field. This format service should nullify empty fields  
2. Create a document from Flat File schema. Uncheck ‘Field must exit at run time’ checkbox for all required flieds  
3. invoke pub.schema:validate and valid against FF document.  
4. Then invoke convertToString.

Hope will help  
UMG

---

<div class="post-metadata">

**Author:** ![mark\_b](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark\_b](https://techcommunity.softwareag.com/u/mark_b)\
**Post date:** [January 18, 2005, 6:17pm UTC](https://techcommunity.softwareag.com/t/mandatory-records-and-fields-are-not-generating-errors-for-xml-to-flat-file-conversions-when-the/107351/4 "2005-01-18T18:17:32Z")

</div>

Thank you for the fast response. I will try this out.

---

<div class="post-metadata">

**Author:** ![mark\_b](https://avatars.discourse-cdn.com/v4/letter/m/f6c823/32.png) [@mark\_b](https://techcommunity.softwareag.com/u/mark_b)\
**Post date:** [January 18, 2005, 6:51pm UTC](https://techcommunity.softwareag.com/t/mandatory-records-and-fields-are-not-generating-errors-for-xml-to-flat-file-conversions-when-the/107351/5 "2005-01-18T18:51:46Z")

</div>

It worked! Thanks again for the help.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/techcommunity/original/3X/c/d/cd19967bb605d28a72d77eb83a1cae22f3df2eb8.svg) [@system](https://techcommunity.softwareag.com/u/system)\
**Post date:** [April 2, 2021, 3:04pm UTC](https://techcommunity.softwareag.com/t/mandatory-records-and-fields-are-not-generating-errors-for-xml-to-flat-file-conversions-when-the/107351/6 "2021-04-02T15:04:45Z")

</div>


