Page 1 of 1

Allocate a DS for XML data

PostPosted: Mon Sep 17, 2012 6:53 pm
by claes_douglas
Hello,

New to datasets and JCL so please forgive my naivety.

If I have created a quite large amount of XML data stored in one string, how do I allocate a DS in order to handle that writing this long string to the DS does not truncate the data but rather wraps it around?
That is, I don’t want the data to be truncated after the LRECL length but simply written to the next line.

If it’s not possible I could probably just write LRECL bytes of data at a time to it, but it’d be nice to just do it in one write operation.
Of course, using HFS files would be a very appealing alternative too but that’s not currently possible.

Re: Allocate a DS for XML data

PostPosted: Mon Sep 17, 2012 6:59 pm
by Robert Sample
As long as your XML does not exceed 32767 bytes -- ever -- then you can do a single write. Otherwise, you will have to break it into pieces, each no longer than 32767 bytes, and write them as individual records. On the other end, you'll need to reconstitute a single variable from all the records before doing your XML PARSE.

Re: Allocate a DS for XML data

PostPosted: Mon Sep 17, 2012 7:08 pm
by claes_douglas
Thanks! Will most probably do the writing in chunks then.