Page 1 of 1

XML Output Stage File Name Split

Posted: Mon Jan 28, 2013 4:24 pm
by MrBlack
Does anyone know if it's possible when outputting xml to a file to control what the file name is going to be when you split it? All my tests show that it just starts appending 1...99 to whatever root name I give it.

Posted: Mon Jan 28, 2013 4:44 pm
by chulett
That's how it works.

My 'workaround' in the past was a post-process that renamed all of the split instances with the names that I needed them to be.

Posted: Mon Jan 28, 2013 8:41 pm
by chulett
Been pondering this and I believe that new environment variables may have been added to control this, at least to some degree. Let me see what I can find, or perhaps Ernie will stop by.

Posted: Tue Jan 29, 2013 12:55 am
by chulett
OK, found what I was thinking. Check the XML Pack Guide pdf and the Writing output to your file system section of Chapter 4. You'll see mention of these 'column index flags' there:

%% Column position, starting with zero (0)
%@ Column names

The latter may help you.

Posted: Tue Jan 29, 2013 8:23 am
by eostic
I've also played games with using a Server Job and sending the split xml content downstream as individual rows to a folder stage. Been awhile, so I don't remember how flexible it is, but the folder stage has a few ways to create multiple files also.

Ernie

Posted: Tue Jan 29, 2013 8:24 am
by eostic
...and if you are reading this and using 9.1, the Sequential Stage introduced an ability to write to multiple files based on a break of some kind, similar to the trigger in the xmlOutput Stage, so you could send you content on each row and then use a Sequential Target (in 9.1 and above).

Ernie

Posted: Thu Jan 31, 2013 5:27 pm
by MrBlack
I think going from the XML Output to a Folder stage is probably the right track. I read too the documentation mentioning the use of %% and %@. When I connected a folder stage I started getting mapping errors on my job. I'm probably not using the Folder Stage correctly. Because the input on the XML is all my tags but what should the output columns on the XML stage be? wouldn't it just be one column that would be the data stream that becomes a file?

If I try and use the %% or %@ on the XML stage without an output throws an error and that is why I think I need to output the XML to the folder stage.

Posted: Tue Feb 05, 2013 9:07 am
by eostic
On the output link of your xmlOutput Stage have just one single column....make it a longvarchar with a length of (say) 99999 and put a single "/" in the Description property. That will send your entire manufactured xml content downstream in a single column on a single row (assuming you choose the aggregate option for the Stage).

Ernie