View previous topic :: View next topic
|
Author |
Message |
bhima patra
New User
Joined: 02 Jan 2015 Posts: 5 Location: India
|
|
|
|
I have XML data in a file as given below.There may be N number sets, each set of XML data separated by space.We have requirement to copy the data into five files.Data in five Output files need be in same format, set of XML data separated by spaces.
<?xml version="1.0" encoding="IBM037"?><InvoiceDetail-List>
" DivisionCode="1001" HeaderCharges="0.00" HeaderDiscount="
="" TotalAmount="139.30" TotalCharges="16.11" TotalDiscount
OrderType="SALES" SellerOrganizationCode="Target.com"><Extn
</InvoiceDetail></I nvoiceDetail-List>
<?xml version="1.0" encoding="IBM037"?><InvoiceDetail-List>
erTax="0.00" InvoiceNo="2849456" InvoiceType="INFO" LineSub
506722" OrderType="SALES" SellerOrganizationCode="Target.co
Christopher" LastName="Miller" MiddleName="" MobilePhone=""
</InvoiceDetail></InvoiceDetail-List>
<?xml version="1.0" encoding="IBM037"?><InvoiceDetail-List>
erTax="0.00" InvoiceNo="2849456" InvoiceType="INFO" LineSub
ExtnNetRefundAmount="0.00"/><PersonInfoShipTo City="Monroev
Christopher" LastName="Miller" MiddleName="" MobilePhone=""
</InvoiceDetail></InvoiceDetail-List>
<?xml version="1.0" encoding="IBM037"?><InvoiceDetail-List>
erTax="0.00" InvoiceNo="2849456" InvoiceType="INFO" LineSub
0" TotalTax="0.00"><Extn ExtnConcessionReasonCode="DE" Extn
Christopher" LastName="Miller" MiddleName="" MobilePhone=""
</InvoiceDetail></InvoiceDetail-List>
<?xml version="1.0" encoding="IBM037"?><InvoiceDetail-List>
erTax="0.00" InvoiceNo="2849456" InvoiceType="INFO" LineSub
Christopher" LastName="Miller" MiddleName="" MobilePhone=""
</InvoiceDetail></InvoiceDetail-List> |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Your XML is a mess, but let's leave that aside (perhaps just a pasting problem).
I'd use WHEN=GROUP with BEGIN= for <?xml version=. Don't know whether you have fixed- or variable-length records, but I'd END= appropriately for the blank line as well. PUSH an ID=1. Then have five OUTFILs, with INCLUDE= for 1, for the first, 2 for the second, etc. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
bhima patra wrote: |
There may be N number sets, ... requirement to copy the data into five files. Data in five Output files ... |
So, is that N or 5 files ? What will be their names ?
And how do you decide which set goes into which file ?
In your XML, it seems values are passed as attributes, not as elements.
Whoever prepared that file should probably think again. |
|
Back to top |
|
|
bhima patra
New User
Joined: 02 Jan 2015 Posts: 5 Location: India
|
|
|
|
Marso wrote: |
bhima patra wrote: |
There may be N number sets, ... requirement to copy the data into five files. Data in five Output files ... |
So, is that N or 5 files ? What will be their names ?
And how do you decide which set goes into which file ?
In your XML, it seems values are passed as attributes, not as elements.
Whoever prepared that file should probably think again. |
I mean N number of XML record sets separated by space in input file. |
|
Back to top |
|
|
bhima patra
New User
Joined: 02 Jan 2015 Posts: 5 Location: India
|
|
|
|
bhima patra wrote: |
Marso wrote: |
bhima patra wrote: |
There may be N number sets, ... requirement to copy the data into five files. Data in five Output files ... |
So, is that N or 5 files ? What will be their names ?
And how do you decide which set goes into which file ?
In your XML, it seems values are passed as attributes, not as elements.
Whoever prepared that file should probably think again. |
I mean N number of XML record sets separated by space in input file. |
Need to Split into five files |
|
Back to top |
|
|
bhima patra
New User
Joined: 02 Jan 2015 Posts: 5 Location: India
|
|
|
|
Bill Woodger wrote: |
Your XML is a mess, but let's leave that aside (perhaps just a pasting problem).
I'd use WHEN=GROUP with BEGIN= for <?xml version=. Don't know whether you have fixed- or variable-length records, but I'd END= appropriately for the blank line as well. PUSH an ID=1. Then have five OUTFILs, with INCLUDE= for 1, for the first, 2 for the second, etc. |
file is FB,LRCL=200, Please provide the syntex. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
The syntax is in the manual.
For an FB I'd code the END= as (1,200,CH,EQ,C' '). |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
Need to Split into five files |
You already told that ...
WHAT ARE THE RULES
round robin will need just one pass
file1 => 1 6 11 ...
file2 => 2 7 12 ...
file3 => 3 8 13 ...
file4 => 4 9 14 ...
file5 => 5 10 15...
contiguous split 2 passes ( the first one to count the number of records )
file1 => 1 2 3 4 5 6 ...
file2 => ...
file3 => ...
file4 => ...
file5 => ...
depending on N files 2 to 5 might contain one record less |
|
Back to top |
|
|
|