|
View previous topic :: View next topic
|
| Author |
Message |
pravinj
New User

Joined: 10 Jun 2008 Posts: 24 Location: india
|
|
|
|
I have a requirement to write multiple records to an output file based on the provided template and the input file. Fields from the input file would be written to the output file based on the template record.
For example,
Template record:
XXXX,YYYY,A,B,C,D
Input file:
1111,2222
3333,4444
5555,6666
7777,8888
Output file expected:
1111,2222,A,B,C,D
3333,4444,A,B,C,D
5555,6666,A,B,C,D
7777,8888,A,B,C,D
How can this be achieved? I tried to achieve this with multiple logics - one is to repeat the template record to the number of records in the input file and join them. It didn't work as I didn't find any clue to do that. Input file count is expected to be in millions. |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
You must do a better job in explaining Your requirement.
the wording tells something, but the example tells something much simpler
the wording implies some kind of pattern matching,
the example can be solved by a simple copy with the proper build statements
rethink on how to explain better the whole shebang  |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| based on the provided template and the input file |
How can you expact anyone to help you when you've shown us only one possible template, and not explained the rules for what the template can look like and how it should be applied to the other file's records?
You need to do a much better job of explaining what you're trying to do and all the possible variations before anyone can help you. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Global Moderator

Joined: 20 Oct 2006 Posts: 6965 Location: porcelain throne
|
|
|
|
regardless if the TS gets back,
i think that modifying this solution by Frank will do the trick:
ibmmainframes.com/viewtopic.php?p=106139&highlight=append#106139
now i realize that it does not have the 'dynamic nature' of finding and using a found datafield,
but, if file 1 just contained the data to be used as the overlay value,
something slick could be created to create a dynamic sysname from file 1,
and a search for last non-char (first space) for overlay start could be created.
but, then again, how many different file types would you want to append data?
inotherwords, minor change of control cards for different files.
sorry guys, it is friday night, been a loooooong week,
don't know when to shut-up.
have a good weekend. |
|
| Back to top |
|
 |
enrico-sorichetti
Superior Member

Joined: 14 Mar 2007 Posts: 10903 Location: italy
|
|
|
|
| Quote: |
| don't know when to shut-up. |
if You knew we would lose half of the fun of hanging around here  |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|