Problem with convertToString - please help

I have read the Flat file documentation and checked the knowledge base to no avail. Please help me with this situation.

First of all, I have been working with WM 6.1 for about a year, so I have very limited experience with Flat files. Within my MapVarToFF service, I’m properly mapping my input variables to a flat file, but I’m having issues when it comes to using the pub:flatFile:convertToString service. My situation is that I am utilizing the convertToString, but the output string is completely empty and the errorArray is null, even though it seems that I have everything set up correctly.

Here are some observations:

Because of my limited knowledge, the schema and Flat file dictionary was built for me. The dictionary looks correct and the record identifier shows “recordWithNoID”. As for the schema, when I click the Flat File Structure tab, there’s only two things filled out in there: the Name and the Type. I see in the properties tab that it refers to the proper dictionary and the Name is recordWithNoID. Also, a schema document type was created.

As for the convertToString service, a document reference to the schema document type is linked to the ffValues document (service in of converttostring). If I click the + sign for the document reference, I see a document list called recordWithNoID and that list is linked to ffValues. The link is in blue. ffSchema variable of convertToString has the name of the schema hardcoded within it, and in Delimiters, I placed the pipe sign ( | ), because I need each output field to be separated by a pipe. Service Out is the string and the string is linked to the same string variable in Pipeline Out.

Does anything above sound incorrect? What can I check/modify in order to get some output? Everytime that I run this service, I can see in the Results section that ffValues is showing every single one of my fields, but the string constantly shows that it is empty. Please help with this, as I should have had this completed over a week ago.

Lastly: some of the fields in my input flat file are blank and will always be blank. Is that an issue?

Hi ken

recordWithNoID document list will be created if in the flatfile there is no record identifier.And before using in the flow services first validate the flatfile schema against the flatfile.

you can do this just click on the flatfile schema there you see the run button.
if you run it asks for the flatfile location.Browse the flatfile for which you have created the schema.

if it is running vht out any errors then you check in the flow service.if the map is in blue color that means it is indexed.also check vht out any delimeters .In general record delimeter and field delimeter all the things will be mentioned in ffschema.

Thanks for the reply. I did exactly as you mentioned and it’s true that my schema wasn’t properly matched up to the flat file. However, when I run the convertToString, I’m still getting null pointer exception errors. Any other suggestions?

Thanks.

Kendrix,

Bascially you dont have to set the delimiters in the convertToString,just map the ffValues,set the FFSchema name (fully qualified),it gives out flatfile string.In the FFSchema definition all the problem lies here ,specify proper record parser,field delimiter,fixed positions etc…you are ok with recordWithNoID option.

So please test the file with schema and if it works convertToString works fine.

HTH,
RMG

hi,kendrix
since this is a “recordWithNoID” schema, i don’t think you should have seen the file structure in flatfile struction tab. Try to switch to the file File definition tab in schema, at the right top area, there is a set botton,and you can set the record definition here.
And plus , i don’t think there should be a blue link. Because blue link means you’ve assign the index of an array.Try to relink the ffvalues to ur document reference.it should be black. I hope this will help.
Nancy