Hello Forum,
How do I go about writing extra records for every record read in? For instance, if a input sequential file has 300 records, the output should have 600.
Input:
14,A,<FI RSSD901="35301" RSSD905="0014">
628,A,<FI RSSD901="82203 RSSD905="0628">
Output:
14,A,<FI RSSD901="35301" RSSD905="0014">
14,A,<CONCEPTS>
628,A,<FI RSSD901="82203 RSSD905="0628">
628,A,<CONCEPTS>
I read in a mixture of XML and key/text data and then I have to create new XML tags based on input info. It might not always be "<CONCEPTS>" as in my example above. This logic is located as a job within a sequence. The majority of the sequence is parallel. But this logic has to be sequential.
Thanks for any advice.
Writing extra records
Moderators: chulett, rschirm, roy
Writing extra records
Ronnie B
-
- Premium Member
- Posts: 783
- Joined: Mon Jan 16, 2006 10:17 pm
- Location: Sydney, Australia
Thanks for replying Keshav0307.
I don't see where I can install logic (like IF-THEN-ELSE) within the COPY stage though. As I said in my post, I have to add XML tags based on input data.
Another example is if I create a Transformer Stage variable, I would like to build a new output record if the stage variable resolves to "true", write out the new record line, then write out the input record. This process is then repeated for every input record, though not every input record may need an additional line written.
Can this be done? More importantly, can this be done within the Transformer stage?
Thanks
I don't see where I can install logic (like IF-THEN-ELSE) within the COPY stage though. As I said in my post, I have to add XML tags based on input data.
Another example is if I create a Transformer Stage variable, I would like to build a new output record if the stage variable resolves to "true", write out the new record line, then write out the input record. This process is then repeated for every input record, though not every input record may need an additional line written.
Can this be done? More importantly, can this be done within the Transformer stage?
Thanks
Ronnie B
You cannot put in any conditions to a copy stage, but you can use your proprosed logic in a transform stage to create 2 output links with different value and then join them together with a funnel.
<a href=http://www.worldcommunitygrid.org/team/ ... TZ9H4CGVP1 target="WCGWin">
</a>
</a>
Can you not use the old trick of supplying your own EOR characters in a string to create multiple records from a 'single' record? There's a FAQ on the subject, btw.
Use the logic noted in a transformer to still produce 'one' record, but one that will (at the appropriate times) turn into two when landed and read back in. When you need this 'new record', concatenate it to the normal record with the appropriate EOR character(s) between them and write the result to a sequential file. Kind of a Reverse Thunderdome - one man enters, two men leave.
Use the logic noted in a transformer to still produce 'one' record, but one that will (at the appropriate times) turn into two when landed and read back in. When you need this 'new record', concatenate it to the normal record with the appropriate EOR character(s) between them and write the result to a sequential file. Kind of a Reverse Thunderdome - one man enters, two men leave.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Thank you ArndW and Chulett for your responses!
I did a mixture of both of your suggestions. I used EOR (End of Record, I presume) characters in which I was able to retrieve a couple of the commands to perform that from a previous post titled, "writing multiple lines from 1 source row", from roy.
After creating multiple lines and multiple output links, I funnelled the files together to form a perfectly organized XML document.
Thanks!
p.s.- I looked for the FAQ mentioned by Chulett on this subject and couldn't find it. All I see under FAQ are topics regarding administrative type stuff such as signon's, registration, etc. Where or how do I find the technical FAQ? I could add a new post stating where to find the technical FAQ if so needed. Just let me know.
I did a mixture of both of your suggestions. I used EOR (End of Record, I presume) characters in which I was able to retrieve a couple of the commands to perform that from a previous post titled, "writing multiple lines from 1 source row", from roy.
After creating multiple lines and multiple output links, I funnelled the files together to form a perfectly organized XML document.
Thanks!
p.s.- I looked for the FAQ mentioned by Chulett on this subject and couldn't find it. All I see under FAQ are topics regarding administrative type stuff such as signon's, registration, etc. Where or how do I find the technical FAQ? I could add a new post stating where to find the technical FAQ if so needed. Just let me know.
Ronnie B
Ronnie wrote:I did a mixture of both of your suggestions. I used EOR (End of Record, I presume) characters in which I was able to retrieve a couple of the commands to perform that from a previous post titled, "writing multiple lines from 1 source row", from roy.
That was the FAQ I mentioned, Roy's post in the FAQ forum, not anything from the FAQ section of the website. Sorry for the confusion.Ronnie wrote:p.s.- I looked for the FAQ mentioned by Chulett on this subject and couldn't find it.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers