Allocate a DS for XML data



JES, JES2, JCL utilities, IDCAMS, Compile & Run JCLs, PROCs etc...

Allocate a DS for XML data

Postby claes_douglas » Mon Sep 17, 2012 6:53 pm

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.
claes_douglas
 
Posts: 3
Joined: Mon Sep 17, 2012 6:00 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Allocate a DS for XML data

Postby Robert Sample » Mon Sep 17, 2012 6:59 pm

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.

These users thanked the author Robert Sample for the post:
claes_douglas (Mon Sep 17, 2012 7:23 pm)
Robert Sample
Global moderator
 
Posts: 3720
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: Allocate a DS for XML data

Postby claes_douglas » Mon Sep 17, 2012 7:08 pm

Thanks! Will most probably do the writing in chunks then.
claes_douglas
 
Posts: 3
Joined: Mon Sep 17, 2012 6:00 pm
Has thanked: 1 time
Been thanked: 0 time


Return to JCL

 


  • Related topics
    Replies
    Views
    Last post