View previous topic :: View next topic
|
Author |
Message |
Hari108 Currently Banned New User
Joined: 29 Jun 2006 Posts: 5
|
|
|
|
I have a COBOL program which reads a file with zip code in it and appends it to a template file which is a XML template file and creates the output in a different file.
My problem is I have thousands of zip codes in the input file and my program is appending it to the template and every new version of this XML is getting appended to the o/p file.
I need a solution to split the XML in the 3rd file into multiple files. Experts any thoughts on this!!!
PS: standard XML length is say 52 lines or 52 records |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
You have a COBOL program, you can change its behavior?
Your thousands of zip codes are creating thousands of XML records?
You need to split the (thousands?) of XML records to a third file or into 3 files?
Your XML has a standard length? |
|
Back to top |
|
|
Hari108 Currently Banned New User
Joined: 29 Jun 2006 Posts: 5
|
|
|
|
1. No, I can't change the programs behavior
2. Yes, It is creating thousands of XML's after inserting the zip code into a particular attribute value of the XML template.
3&4. I need to split 1000 XML's (1 XML is of 52 records, each record is of length 250 this is standard) into 1000 different files or any other way which will be best by which i can download it straight to my PC.
I tried with SPLITBY=52 option, but i had to give n no. of OUTFIL to generate n no. of XML files
I was able to seperate the master file with 20 XML's ...but it was time consuming |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
given the number of splitted files, it would be much simpler to download to the pc the whole file, and do the splitting on the PC; |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
My thoughts:
- Instead of cataloging 1000 datasets, maybe it would be better to create a PDS with 1000 members.
- I'm pretty sure that you can use DFSORT to generate an output dataset of all the required DD statements necessary to split the input into. This would be able to dynamically determine how many output DD statements would be needed based on the input. This would, of course, require that this output dataset be used in a subsequent job that would actually do the splits.
- Create a program that can properly split the dataset and dynamically create all of the necessary output datasets (or PDS members). |
|
Back to top |
|
|
Hari108 Currently Banned New User
Joined: 29 Jun 2006 Posts: 5
|
|
|
|
Thanks for your thoughts folks |
|
Back to top |
|
|
|